Hi,
I am using RadGrid of version "2009.2.701.35". I need have some 5 to 7 columns as invisible columns. My template column goes like this:
<telerik:GridTemplateColumn HeaderText="" UniqueName="colAttributeId" DataField="AttributeId" ItemStyle-Width="0px" HeaderStyle-Width="0px">
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" />
<ItemTemplate><asp:Label ID="lblAttributeId" runat="server" Text='<%# Bind("AttributeId") %>'></asp:Label></ItemTemplate>
</telerik:GridTemplateColumn>
But in the screen the borders are getting displayed (which we want to avoid). Please see the screenshot attached.
We want to access those data from clientside. If we made the column's visible property as 'False' means we couldnt access those data from clientside javascript code. So we specified the width as "0px".
I tried even setting the border's to 0px, it shows an empty space.
<HeaderStyle BorderStyle="None" BorderWidth="0px" />
<ItemStyle BorderStyle="None" BorderWidth="0px" />
If anyone know how to access the invisible column's data from client-side pls share with me.
Thanks in advance.
| if (e.Item is GridEditableItem && e.Item.IsInEditMode) |
| { |
| GridEditableItem item = e.Item as GridEditableItem; |
| GridTextBoxColumnEditor editor = (GridTextBoxColumnEditor)item.EditManager.GetColumnEditor("PersonId"); |
| TableCell cell = (TableCell)editor.TextBoxControl.Parent; |
| RequiredFieldValidator validator = new RequiredFieldValidator(); |
| editor.TextBoxControl.ID = "ID_for_validation"; |
| validator.ControlToValidate = editor.TextBoxControl.ID; |
| validator.ErrorMessage = "You must enter a PersonId"; |
| cell.Controls.Add(validator); |
| GridTextBoxColumnEditor editor2 = (GridTextBoxColumnEditor)item.EditManager.GetColumnEditor("ContactWhere"); |
| TableCell cell2 = (TableCell)editor2.TextBoxControl.Parent; |
| RequiredFieldValidator validator2 = new RequiredFieldValidator(); |
| editor2.TextBoxControl.ID = "ID_for_validation2"; |
| validator2.ControlToValidate = editor2.TextBoxControl.ID; |
| validator2.ErrorMessage = "You must enter a H, C or M"; |
| cell2.Controls.Add(validator2); |
| Protected Sub panelmenu1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadPanelBarEventArgs) Handles panelmenu1.ItemDataBound |
| Dim dataRow As DataRowView = DirectCast(e.Item.DataItem, DataRowView) |
| If functions.FucGetPageID = dataRow("ID").ToString() Then |
| e.Item.Selected = True |
| e.Item.Expanded = True |
| End If |
| End Sub |
| <telerik:RadPanelBar runat="server" EnableViewState="false" CausesValidation="False" EnableEmbeddedSkins="False" ID="panelmenu1" Width="100%" OnPreRender="panelmenu1_PreRender" OnItemClick="RadPanelBar1_ItemClick" /> |