0 Replies - 752 Views - Last Post: 25 July 2013 - 09:10 PM Rate Topic: -----

#1 C#Guy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 21-February 12

Placing textboxes of auto CRUD RadGrid in two columns

Posted 25 July 2013 - 09:10 PM

Hello everyone,

I have this auto CRUD RadGrid with AllowAutomaticDeletes="True"
AllowAutomaticInserts="True" AllowAutomaticUpdates="True" properties. The grid provides textboxes automatically when I want to add new records or edit. What I want to do is to place the auto-generated textboxes provided by the grid in two columns. I've goggled but it was no help. The following is the coded I used.
Please help me out. Thanks.
<telerik:RadGrid ID="RadGridPeopleJobGrade" GridLines="None" runat="server" AllowAutomaticDeletes="True"
            AllowAutomaticInserts="True" PageSize="10" AllowAutomaticUpdates="True"
            AllowPaging="True" AutoGenerateColumns="False" OnNeedDataSource="RadGridPeopleJobGrade_OnNeedDataSource"
            OnUpdateCommand="RadGridPeopleJobGrade_OnUpdateCommand" OnInsertCommand="RadGridPeopleJobGrade_OnInsertCommand"
            OnDeleteCommand="RadGridPeopleJobGrade_OnDeleteCommand" OnItemDataBound="RadGridPeopleJobGrade_OnItemDataBound">
            <ClientSettings>
                <Scrolling AllowScroll="false" />
            </ClientSettings>
            <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
            <MasterTableView TableLayout="Auto" CommandItemDisplay="TopAndBottom" DataKeyNames="PeopleJobGradeID"
                HorizontalAlign="NotSet" AutoGenerateColumns="False">
                <Columns>
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                        <ItemStyle CssClass="MyImageButton"></ItemStyle>
                    </telerik:GridEditCommandColumn>
                    <%--<telerik:GridBoundColumn DataField="PeopleJobGradeID" HeaderText="People Job Grade ID"
                        SortExpression="PeopleJobGradeID" UniqueName="PeopleJobGradeID" ColumnEditorID="GridTextBoxColumnEditor1">
                        <ColumnValidationSettings EnableRequiredFieldValidation="true">
                            <RequiredFieldValidator ForeColor="Red" Text="*This field is required">
                            </RequiredFieldValidator>
                        </ColumnValidationSettings>
                    </telerik:GridBoundColumn>--%>
                    <telerik:GridBoundColumn DataField="JobGrade" HeaderText="JobGrade" SortExpression="JobGrade"
                        UniqueName="JobGrade" ColumnEditorID="GridTextBoxColumnEditor1">
                        <ColumnValidationSettings EnableRequiredFieldValidation="true">
                            <RequiredFieldValidator ForeColor="Red" Text="*This field is required">
                            </RequiredFieldValidator>
                        </ColumnValidationSettings>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Description" HeaderText="Description" SortExpression="Description"
                        UniqueName="Description" ColumnEditorID="GridTextBoxColumnEditor1">
                        <ColumnValidationSettings EnableRequiredFieldValidation="true">
                            <RequiredFieldValidator ForeColor="Red" Text="*This field is required">
                            </RequiredFieldValidator>
                        </ColumnValidationSettings>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Rank" HeaderText="Rank" SortExpression="Rank"
                        UniqueName="Rank" ColumnEditorID="GridTextBoxColumnEditor1">
                        <ColumnValidationSettings EnableRequiredFieldValidation="true">
                            <RequiredFieldValidator ForeColor="Red" Text="*This field is required">
                            </RequiredFieldValidator>
                        </ColumnValidationSettings>
                    </telerik:GridBoundColumn>   
                    <%--<telerik:GridTemplateColumn HeaderText="IsEnabled" SortExpression="IsEnabled" UniqueName="IsEnabled"
                        EditFormColumnIndex="1">
                        <ItemTemplate>
                            <asp:Label runat="server" ID="lblIsEnabled" Text='<%# Eval("IsEnabled") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <span>
                                <telerik:RadComboBox runat="server" ID="cboIsEnabled" Width="40px" >
                                </telerik:RadComboBox>
                                </span> </span>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn> --%>                
                    <telerik:GridDropDownColumn DataField="IsEnabled" HeaderText="IsEnabled" SortExpression="IsEnabled"
                        UniqueName="cboIsEnabled" ColumnEditorID="GridDropDownColumnEditor1" DropDownControlType="RadComboBox">                        
                    </telerik:GridDropDownColumn>
                    <telerik:GridBoundColumn DataField="CreatedBy" HeaderText="CreatedBy" SortExpression="CreatedBy"
                        UniqueName="CreatedBy" ColumnEditorID="GridTextBoxColumnEditor1">
                        <%--<ColumnValidationSettings EnableRequiredFieldValidation="true">
                            <RequiredFieldValidator ForeColor="Red" Text="*This field is required">
                            </RequiredFieldValidator>
                        </ColumnValidationSettings>--%>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="CreatedOn" HeaderText="CreatedOn" SortExpression="CreatedOn"
                        UniqueName="CreatedOn" ColumnEditorID="GridTextBoxColumnEditor1">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ModifiedBy" HeaderText="ModifiedBy" SortExpression="ModifiedBy"
                        UniqueName="ModifiedBy" ColumnEditorID="GridTextBoxColumnEditor1">
                        <%--<ColumnValidationSettings EnableRequiredFieldValidation="true">
                            <RequiredFieldValidator ForeColor="Red" Text="*This field is required">
                            </RequiredFieldValidator>
                        </ColumnValidationSettings>--%>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ModifiedOn" HeaderText="ModifiedOn" SortExpression="ModifiedOn"
                        UniqueName="ModifiedOn" ColumnEditorID="GridTextBoxColumnEditor1">
                    </telerik:GridBoundColumn>
                    <telerik:GridButtonColumn ConfirmText="Delete this record?" ConfirmDialogType="RadWindow"
                        ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                        UniqueName="DeleteColumn" >
                        <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton"></ItemStyle>
                    </telerik:GridButtonColumn>
                </Columns>
                <EditFormSettings ColumnNumber="2" CaptionDataField="PeopleJobGradeID" CaptionFormatString="Edit properties of PeopleJobGrade {0}"
                    InsertCaption="New PeopleJobGrade" >                                                                  
                    <FormTableItemStyle  Wrap="False"></FormTableItemStyle>
                    <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
                    <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" Width="100%">
                    </FormMainTableStyle>
                    <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px">                     
                    </FormTableStyle>
                    <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                    <EditColumn ButtonType="ImageButton" InsertText="Insert PeopleJobGrade" UpdateText="Update record"
                        UniqueName="EditCommandPeopleJobGrade" CancelText="Cancel edit">
                    </EditColumn>
                    <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
                </EditFormSettings>                
            </MasterTableView>
            <ClientSettings>
                <ClientEvents OnRowDblClick="RowDblClick" OnGridCreated="gridCreated"></ClientEvents>
            </ClientSettings>
        </telerik:RadGrid>



Is This A Good Question/Topic? 0
  • +

Page 1 of 1