I've a radpanel bar and I've 3 radpnelItems with a radgrid in each one.
My question is I need to find out the selected rows in a grid.
I did the foll:
RadGrid m_obRecipientGroupGrid = (RadGrid)m_ctlRecipientPanelBar.FindItemByValue("RadPanelRecipientGroup").FindControl("m_radRecipientGroupGrid");
foreach (GridDataItem obItem in m_obRecipientGroupGrid.SelectedItems)
{
int iGroupId = Convert.ToInt32(obItem["GroupId"].Text);
objRecipientGroupIdList.Add(iGroupId);
}
Note:; m_ctlRecipientPanelBar is the name of the panel bar
m_radRecipientGroupGrid is the name of the radgrid
When i checked a checkbox(it automatically means the rows is selected right) and click on save(in my page), I do the above code, but it never goes to this loop though i've selected few checkboxes.
and as a result the list is empty.
But the same logic (like the same code) i did in my radgrid without a radpanel item and it worked. why didn't this when i put the radgrid in a radpanel bar doesn't give me the selected rows.
pls help me. how do i do this???
Note: i also have allowmultirowselect = true.
m_radRecipientGroupGrid .clientsettings.selecting.AllowRowSelect = true;
Pls do help me
| <telerik:RadGrid |
| ID="rgOrganisation" |
| runat="server" |
| GridLines="None" |
| Width="500px" |
| AutoGenerateColumns="False" |
| Skin="CPSM" |
| EnableEmbeddedSkins="False"> |
| <MasterTableView DataKeyNames="Organisation_ID" EditMode="InPlace" CommandItemDisplay="None"> |
| <Columns> |
| <telerik:GridBoundColumn DataField="Organisation_ID" DataType="System.Int32" HeaderText="Organisation_ID" ReadOnly="True" SortExpression="Area_ID" UniqueName="Organisation_ID" Visible="False"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Organisation" HeaderText="Organisation" SortExpression="Organisation" UniqueName="Organisation"></telerik:GridBoundColumn> |
| </Columns> |
| <RowIndicatorColumn><HeaderStyle Width="20px" /></RowIndicatorColumn> |
| <ExpandCollapseColumn><HeaderStyle Width="20px" /></ExpandCollapseColumn> |
| <DetailTables> |
| <telerik:GridTableView runat="server" CommandItemDisplay="Bottom" DataKeyNames="Organisation_ID" Width="100%" > |
| <Columns> |
| <telerik:GridEditCommandColumn CancelImageUrl="../App_Themes/Default/Grid/Cancel.gif" EditImageUrl="../App_Themes/Default/Grid/Edit.gif" InsertImageUrl="../App_Themes/Default/Grid/Update.gif" UpdateImageUrl="../App_Themes/Default/Grid/Update.gif" ButtonType="ImageButton"><HeaderStyle Width="15px" /><ItemStyle Width="15px" /></telerik:GridEditCommandColumn> |
| <telerik:GridBoundColumn DataField="Organisation_ID" DataType="System.Int32" UniqueName="Organisation_ID" Visible="false"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Organisation" HeaderText="Organisation" ></telerik:GridBoundColumn> |
| <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" Text="Delete" ImageUrl="../App_Themes/Default/Grid/delete.gif" ConfirmDialogType="RadWindow" ConfirmText="Are you sure you want to delete this Location"><HeaderStyle Width="10px" /><ItemStyle Width="10px" /></telerik:GridButtonColumn> |
| </Columns> |
| <CommandItemSettings AddNewRecordText="Add new Division" RefreshText=" " /> |
| <RowIndicatorColumn><HeaderStyle Width="20px" /></RowIndicatorColumn> |
| <ExpandCollapseColumn><HeaderStyle Width="20px" /></ExpandCollapseColumn> |
| </telerik:GridTableView> |
| </DetailTables> |
| </MasterTableView> |
| </telerik:RadGrid> |
RadGrid1.Columns[1].Display =
false; But showed me an error.
Then i tried with the following code
RadGrid1.MasterTableView.RenderColumns[1].Display =
false;
This did not show me an error but did not hide the column
Guide me how to go about this.
Jidesh