|
Hi
I have gridview with a values in as well as a dropdownlist
When I click on the dropdownlist to choose a value I need this value to then be updated to the database.
My question is how can I find the id of the current row I am on so that the correct record is updated?
any help on this would be great thanks!
|
|
|
|
|
.netman wrote: I have gridview with a values in as well as a dropdownlist
When I click on the dropdownlist to choose a value I need this value to then be updated to the database.
My question is how can I find the id of the current row I am on so that the correct record is updated?
any help on this would be great thanks!
Do you want to update all gridview data on button click event?
or
Do you want to update only one row on Droddown selected index change event?
regard
khan
please don't forget to vote on the post that helped you.
|
|
|
|
|
I just need to update the row that I am currently on.
I want to update just the value I have chosen from the dropdownlist but I need to match it to the correct ID for that row. hope that makes sense
Also how can I find the dropdownlist for the current row.
I have:
DropDownList dd = ((DropDownList)row2.FindControl("ddorder")); but its showing object reference error
That code above is on my selectecchange event for the dropdownlist
thanks so far!!!
|
|
|
|
|
.netman wrote: I want to update just the value I have chosen from the dropdownlist but I need to match it to the correct ID for that row.
If you want to update single row on dopdown selected index change event then first find out dropdownlist on rowCreatedEvent of gridview and create event handler of selected index changed.
.netman wrote: DropDownList dd = ((DropDownList)row2.FindControl("ddorder"));
Look at here
On rowCreatedEvent of Gridview
if(e.Row.Rowtype==DataControlRowType.DataRow)
{
DropDownList ddl=(DropDownList)e.Row.FindControl("DropDownListID")
ddl.ToolTip=CurrentID;
}
On SelectedIndexChangeEvent,You have two argument e as eventArgs and Sender as an object
cast object to dropdownlist and get selectedValue and update data
for Example
DropDownList ddl=(DropDownList)sender;
string selectedValue=ddl.SelectedValue;
string ID=ddl.ToolTip;
regard
kHan
please don't forget to vote on the post that helped you.
|
|
|
|
|
for the following code its showing error:
if(e.Row.Rowtype==DataControlRowType.DataRow)
error:
'System.Web.UI.WebControls.GridViewRow' does not contain a definition for 'Rowtype'
thanks
also what is currentid supposed to represent? Its throwing up error for that too
|
|
|
|
|
.netman wrote: if(e.Row.Rowtype==DataControlRowType.DataRow)
error:
'System.Web.UI.WebControls.GridViewRow' does not contain a definition for 'Rowtype'
Sorry it is RowType not Rowtype.
c# is case sensitive
if(e.Row.RowType==DataControlRowType.DataRow)
please don't forget to vote on the post that helped you.
|
|
|
|
|
ok thanks that worked now, i should have noticed that!
Next problem is what should currentid be, you put it in your previous post but wat is it?
thanks so far
|
|
|
|
|
OK got it sorted, maanaged to set the current id
thanks for your help!
|
|
|
|
|
If you want to know the current GridViewRow:
DropDownList dd = ((DropDownList)row2.FindControl("ddorder"));
GridViewRow row = (GridViewRow)dd.NamingContainer;
Then you have the complete Row with values from the gridview in your OnSelectedIndexChanged for the DropDownList
|
|
|
|
|
hi,
i need 2+ year question and answer ..... in asp.net and c#.net......
can any one help me
redards,
vidhya.s
|
|
|
|
|
|
|
i need a asp.net questions for interview process can u help me
|
|
|
|
|
so you want us to ask you questions pretending that your an interviewee and we are the interviewer?
|
|
|
|
|
|
Dont vote me 1 just because I am confused by your strange question!!
|
|
|
|
|
cse.vidhya wrote: i need a asp.net questions for interview process can u help me
Yes. Here is the questions
1 - How to use google ?
A) Here[^]
2 - How do you post questions in a technical forums ?
A) here[^]
|
|
|
|
|
Hi...
I am having datagrid. In that i have button column in all the rows. Now on click of button column, grid's DeleteCommand event gets called. But i want to show the no of records affected by deleting and if user press ok , then only this Delete Command should perform delete operation.
How to do this... Plz help...
|
|
|
|
|
You should use a confirm extender control which is ajax.
check this out
http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ConfirmButton/ConfirmButton.aspx
|
|
|
|
|
Instead of putting delete button on each row, you can put a check box on each row so that you will get a list of records to be deleted or modified. If you put delete button on each row, there will be only one record for delete at a time.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Hi,
I am retriving metadata from database .
user can schedule the datetime and status(daily ,weekly,monthly,yearly).
based on this information scheduling will be started and retriving the metadata by using threads.
please help me and send me the code as soon as possible.
regards,
vijay
Vijay
|
|
|
|
|
Dear All,
I have a grid view in my application, which contains child grid for each and every row bounded to it.
I want to have paging in the child grid and I have assigned an event handler for it in the code while binding it to the main grid.
But it is not triggered.
Can any one help me to resolve this issue?
Thanks a lot in advance.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
i receive a value on form from mobile device i get xml and image in mime type which can be .jpeg, .png or any thing else picture format. i am parsing xml and store in database and now i have a problem that how i can change picture in original format from mime type file.
thanks in advance
|
|
|
|
|
Please don't do repeated posting.
|
|
|
|
|
ok there is any answer of my question.
|
|
|
|