| This is my grid view code.... |
| <columns> |
| <telerik:GridBoundColumn DefaultInsertValue="" UniqueName="Code" DataField="Code" |
| HeaderText="Code"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DefaultInsertValue="" UniqueName="Employee" DataField="Employee" |
| HeaderText="Employee"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DefaultInsertValue="" UniqueName="Address" DataField="Address" |
| HeaderText="Address"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DefaultInsertValue="" UniqueName="Location" DataField="Location" |
| HeaderText="Location"> |
| </columns> |
| And my checkboxlist contains following.... |
| <asp:CheckBoxList ID="CheckBoxListThird" runat="server" RepeatColumns="5" Width="100%"> |
| <asp:ListItem Enabled="False" Selected="True" Value="Code">Site ID</asp:ListItem> |
| <asp:ListItem Selected="True">Employee</asp:ListItem> |
| <asp:ListItem Selected="True">Address</asp:ListItem> |
| <asp:ListItem Selected="True">Location</asp:ListItem> |
| </asp:CheckBoxList> |
| In my code behind i am trying something like this.... |
| foreach (DataControlField col in RadGrid.Columns) |
| { |
| if (col.HeaderText.ToUpper() == CheckBoxListFirst.Items[i].Text.ToUpper()) |
| col.Visible = CheckBoxListFirst.Items[i].Selected; |
| } |
| But It is giving me error.... This is just an example i have given i have in my listbox some 60 items.... |
| so i want to come the headertext and item text of grid and checkboxlist.... My scenario fits in this way only..... |
| Please tell me how to achevie it.... |
i have a CheckBoxList Control in my page. When User selects or checks the check box i want to display only those selected Items in the grid.....