hi stuck on something with radgrid and ajax panel
I have a radgrid with 20 columns(15 hidden), one datasource, one textbox, two buttons(search and continue), one table with lierals for the 15 hidden columns outside the grid.
Scenario: Radgrid and table are wrapped in an ajaxpanel. User enters search criteria in textbox 1, radgrid populates based on criteria. User uses COmmandName 'Select' to select row. SelectedIndexChanged grabs values of selected row and populates literals. Very nice. User presses continue and goes to next page. if user uses back button, all data is then missing! This is definitely due to my use of the ajaxpanel. is there a way to keep the page in its selected state and use the ajax?
My designer data is simplified significantly but the idea is there.
thanks
mac
Design is along these lines
I have a radgrid with 20 columns(15 hidden), one datasource, one textbox, two buttons(search and continue), one table with lierals for the 15 hidden columns outside the grid.
Scenario: Radgrid and table are wrapped in an ajaxpanel. User enters search criteria in textbox 1, radgrid populates based on criteria. User uses COmmandName 'Select' to select row. SelectedIndexChanged grabs values of selected row and populates literals. Very nice. User presses continue and goes to next page. if user uses back button, all data is then missing! This is definitely due to my use of the ajaxpanel. is there a way to keep the page in its selected state and use the ajax?
My designer data is simplified significantly but the idea is there.
thanks
mac
Protected Sub RadGrid1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.SelectedIndexChanged |
For Each item As GridDataItem In RadGrid1.MasterTableView.GetItems(New GridItemType() {GridItemType.Item, GridItemType.AlternatingItem}) |
Dim dataitem As GridDataItem = DirectCast(item, GridDataItem) |
If dataitem.Selected Then |
'Access the data in the row using the ColumnUniqueName |
EMP_IDlit.Text = dataitem("EMP_ID").Text |
EMPFirstNamelit.Text = dataitem("EMPFirstName").Text |
EMPLastNamelit.Text = dataitem("EMPLastName").Text |
EMPPoslit.Text = dataitem("EMPPos").Text |
PosDescriptionlit.Text = dataitem("PosDescription").Text |
PosTypelit.Text = dataitem("PosType").Text |
HomePoslit.Text = dataitem("HomePos").Text |
Emp_Statuslit.Text = dataitem("Emp_Status").Text |
Classnlit.Text = dataitem("Classn").Text |
CostCentrelit.Text = dataitem("CostCentre").Text |
site_prelit.Text = dataitem("site_pre").Text |
sitelit.Text = dataitem("site").Text |
Affiliationlit.Text = dataitem("Affiliation").Text |
std_hourslit.Text = dataitem("std_hours").Text |
Documentlit.Text = dataitem("Document").Text |
Departmentlit.Text = dataitem("Department").Text |
homesitelit.text = dataitem("homesite").Text |
infopanel.visible = True |
End If |
Next |
EmpPos = RadGrid1.SelectedValues("EmpPos") |
Empid = RadGrid1.SelectedValues("Emp_ID") |
SelectedID.Text = EmpPos & "|" & Empid & "|" & JDC |
End Sub |
Design is along these lines
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><asp:Button ID="Button1" |
runat="server" Text="Name or Pos#" /> |
<telerik:RadAjaxPanel ID="pnl" runat="server"> |
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"> |
</telerik:RadGrid> |
<datasource> |
<asp:panel id="infoPanel" runat="server"> |
table of literal ctrls |
<asp:button id="Continue" runat=server /> |
</asp:panel> |
</telerik:ajaxPanel> |