This is a migrated thread and some comments may be shown as answers.

Custom Edit Form(Rad Grid)

3 Answers 177 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ismail
Top achievements
Rank 1
Ismail asked on 04 Nov 2008, 10:58 AM
Hi

can anyone help me,i created a RadGrid with a custom edit form,i want to access the controls in my edit form in the c# code behind,i set the controls to runat server why can't i access the3 control? the control i want is called cal1...

<EditFormSettings EditFormType="Template">
<EditColumn UniqueName="EditCommandColumn1"></EditColumn>
                    <FormTemplate>
                    <table id="Table3" cellspacing="1" cellpadding="1" width="250" border="0" class="module">
                     <tr>
                         <td>Maint Date:</td>
                         <td>
                         <asp:Calendar ID="cal1" runat="server" SelectedDate ='<%# Bind( "ScheduledMaint" ) %>' />
                        </td>
                      </tr>
                                <td align="right" colspan="2">
                                   <asp:Button ID="btnUpdate" runat="server" onclick="btnUpdate_Click"
                Text="Update" Width="118px" />
<asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
CommandName="Cancel"></asp:Button></td>                      
                    </table>                    
                    </FormTemplate>
                </EditFormSettings>

3 Answers, 1 is accepted

Sort by
0
Accepted
Missing User
answered on 04 Nov 2008, 11:11 AM
Hi Ismail,


To see more information on the requested functionality, please refer to the following help article:

Greetings,
Plamen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ismail
Top achievements
Rank 1
answered on 04 Nov 2008, 11:23 AM
Tanx for the help guyz,i have one more question.Why can't i get the value of a hidden cell? i trying to get the value of column "id"..

function RowSelected(sender, eventArgs)
{
var dataItem = $get(eventArgs.get_id());
var grid = sender;
MasterTable = grid.get_masterTableView();
var row = MasterTable.get_dataItems()[dataItem.rowIndex];
var cell = MasterTable.getCellByColumnUniqueName(row, "id");
}

<Columns>
        <telerik:GridBoundColumn DataField="id" HeaderText="id" Visible ="false"  
            SortExpression="id" UniqueName="id">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="companyName" HeaderText="Company Name" Visible ="false"  
            SortExpression="companyName" UniqueName="companyName">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="serverOS" HeaderText="Server Name"
            SortExpression="serverOS" UniqueName="serverOS">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ipAddress" HeaderText="IP Address"
            SortExpression="ipAddress" UniqueName="ipAddress">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ScheduledMaint" DataType="System.DateTime"
            HeaderText="Maint Date" SortExpression="ScheduledMaint" UniqueName="ScheduledMaint">
        </telerik:GridBoundColumn>
                        <telerik:GridEditCommandColumn>
</telerik:GridEditCommandColumn>
    </Columns>

Thanx in advance..
0
Accepted
Sebastian
Telerik team
answered on 04 Nov 2008, 11:28 AM
Hello Ismail,

You need to use the Display property of the column to false instead of Visible = false. Thus the column will be rendered with display: none attribute, otherwise it will not be rendered in the browser at all.

If you want to keep your current setting, consider using client key values to retrieve the data from it:

http://demos.telerik.com/ASPNET/Prometheus/Grid/Examples/Client/Keys/DefaultCS.aspx

Best regards,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Ismail
Top achievements
Rank 1
Answers by
Missing User
Ismail
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or