Hi,
I have a grid has <EditFormSettings EditFormType="Template" .
I have a linkbutton draft column in the grid and showing edit form once click on draft link button.
But its binding last row values always .I have written the code in the itemdatabound event.
for example I have 2 records in the grid and If i click on 1st record then it's always showing 2nd row in the edit form popup that mean my code calling twice at this scenario.
itemdatabound calling for every record and showing last record values in the popup.
this is my code :
I would like to show in the editform that exact row what i have clicked in the grid. Please help me on this..
Thanks in advance ..
I have a grid has <EditFormSettings EditFormType="Template" .
I have a linkbutton draft column in the grid and showing edit form once click on draft link button.
But its binding last row values always .I have written the code in the itemdatabound event.
for example I have 2 records in the grid and If i click on 1st record then it's always showing 2nd row in the edit form popup that mean my code calling twice at this scenario.
itemdatabound calling for every record and showing last record values in the popup.
this is my code :
If System.Web.HttpContext.Current.Session("state") IsNot Nothing Then If System.Web.HttpContext.Current.Session("state").ToString = "SaveAsDraft" Then If TypeOf e.Item Is GridDataItem Then Dim item As GridDataItem = TryCast(e.Item, GridDataItem) ViewState("EmailIdValue") = item("id").Text End If If TypeOf e.Item Is GridEditFormItem And e.Item.IsInEditMode Then If e.Item.OwnerTableView.IsItemInserted Then Dim record As New DataTable If ViewState("EmailIdValue") <> "" Then record = GetDataTable("select * from t_EmailFiling where id='" & ViewState("EmailIdValue") & "'") End If If record.Rows.Count > 0 Then Dim insertItem As GridEditFormInsertItem = DirectCast(e.Item, GridEditFormInsertItem) CType(insertItem.FindControl("Recipient"), RadTextBox).Text = record.Rows(0)("Recipient").ToString() CType(insertItem.FindControl("RecipientCC"), RadTextBox).Text = record.Rows(0)("RecipientCC").ToString() CType(insertItem.FindControl("RecipientBCC"), RadTextBox).Text = record.Rows(0)("RecipientBCC").ToString() CType(insertItem.FindControl("Subject"), RadTextBox).Text = record.Rows(0)("Subject").ToString() CType(insertItem.FindControl("Message"), RadEditor).Content = record.Rows(0)("Message").ToString() End If End If End If End If End IfI would like to show in the editform that exact row what i have clicked in the grid. Please help me on this..
Thanks in advance ..