Hi,
When i want to get radgrid selected items, I show that all the cells' values are null. I applied the solutions below but they didn't work.
Please help for getting selected row values.
*******
GridDataItem[] itemm = grdWorkReport.MasterTableView.GetSelectedItems();
string ss = itemm[0]["CalismaTarihi"].Text; ( --->>> ss Returns null )
******
foreach (GridDataItem item in grdWorkReport.SelectedItems)
{
Response.Write(item["CalismaTarihi"].Text.ToString()); // CustomerID is the uniquename of column
}
*******
My radgrid is :
<telerik:RadGrid ID="grdWorkReport" Skin="Sitefinity" runat="server" AllowPaging="True" SelectedItemStyle-BackColor="Orange"
AutoGenerateColumns="False" CellSpacing="0" GridLines="None" Height="350px" OnNeedDataSource="RadGrid1_NeedDataSource" OnItemDataBound="RadGrid1_ItemDataBound"
Width="100%" ShowStatusBar="True" GroupingEnabled="False" AllowSorting="True"
PageSize="10" AllowCustomPaging="True" OnItemCommand="RadGrid1_ItemCommand" SortingSettings-SortToolTip="Sıralamak için buraya basınız." AllowMultiRowSelection="true">
<PagerStyle Mode="NextPrevAndNumeric" PagerTextFormat="{4} {1} sayfada {5} kayıt"
FirstPageToolTip="İlk Sayfa" LastPageToolTip="Son Sayfa" PrevPageToolTip="Önceki Sayfa"
NextPageToolTip="Sonraki Sayfa" />
<ClientSettings>
<Scrolling AllowScroll="True" UseStaticHeaders="True" />
</ClientSettings>
<MasterTableView CommandItemDisplay="Top" AllowFilteringByColumn="false" AllowCustomSorting="true"
Width="100%">
<CommandItemSettings ShowExportToWordButton="false" ShowExportToExcelButton="true"
ShowExportToCsvButton="false" ShowAddNewRecordButton="false"
ExportToExcelText="Excel'e Aktar" />
<CommandItemStyle Height="30px" />
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px" />
</ExpandCollapseColumn>
<Columns>
<telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn">
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" OnCheckedChanged="ToggleRowSelection"
AutoPostBack="True" />
</ItemTemplate>
<HeaderTemplate>
<asp:CheckBox ID="headerChkbox" runat="server" OnCheckedChanged="ToggleSelectedState"
AutoPostBack="True" />
</HeaderTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="RecordId" HeaderText="Kayıt ID" DataField="RecordId"
ReadOnly="true" Visible="false">
<ItemTemplate>
<asp:Label ID="lblRecordId" runat="server" Text='<%# Eval("RecordId") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
When i want to get radgrid selected items, I show that all the cells' values are null. I applied the solutions below but they didn't work.
Please help for getting selected row values.
*******
GridDataItem[] itemm = grdWorkReport.MasterTableView.GetSelectedItems();
string ss = itemm[0]["CalismaTarihi"].Text; ( --->>> ss Returns null )
******
foreach (GridDataItem item in grdWorkReport.SelectedItems)
{
Response.Write(item["CalismaTarihi"].Text.ToString()); // CustomerID is the uniquename of column
}
*******
My radgrid is :
<telerik:RadGrid ID="grdWorkReport" Skin="Sitefinity" runat="server" AllowPaging="True" SelectedItemStyle-BackColor="Orange"
AutoGenerateColumns="False" CellSpacing="0" GridLines="None" Height="350px" OnNeedDataSource="RadGrid1_NeedDataSource" OnItemDataBound="RadGrid1_ItemDataBound"
Width="100%" ShowStatusBar="True" GroupingEnabled="False" AllowSorting="True"
PageSize="10" AllowCustomPaging="True" OnItemCommand="RadGrid1_ItemCommand" SortingSettings-SortToolTip="Sıralamak için buraya basınız." AllowMultiRowSelection="true">
<PagerStyle Mode="NextPrevAndNumeric" PagerTextFormat="{4} {1} sayfada {5} kayıt"
FirstPageToolTip="İlk Sayfa" LastPageToolTip="Son Sayfa" PrevPageToolTip="Önceki Sayfa"
NextPageToolTip="Sonraki Sayfa" />
<ClientSettings>
<Scrolling AllowScroll="True" UseStaticHeaders="True" />
</ClientSettings>
<MasterTableView CommandItemDisplay="Top" AllowFilteringByColumn="false" AllowCustomSorting="true"
Width="100%">
<CommandItemSettings ShowExportToWordButton="false" ShowExportToExcelButton="true"
ShowExportToCsvButton="false" ShowAddNewRecordButton="false"
ExportToExcelText="Excel'e Aktar" />
<CommandItemStyle Height="30px" />
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px" />
</ExpandCollapseColumn>
<Columns>
<telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn">
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" OnCheckedChanged="ToggleRowSelection"
AutoPostBack="True" />
</ItemTemplate>
<HeaderTemplate>
<asp:CheckBox ID="headerChkbox" runat="server" OnCheckedChanged="ToggleSelectedState"
AutoPostBack="True" />
</HeaderTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="RecordId" HeaderText="Kayıt ID" DataField="RecordId"
ReadOnly="true" Visible="false">
<ItemTemplate>
<asp:Label ID="lblRecordId" runat="server" Text='<%# Eval("RecordId") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>