Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
160 views
What I would like to do is hide the title bar of the radwindow and use a close window linkbutton for a radwindow so it smore defined and people understand how to close the radwindow.  This will be no problem but what I need it to do is upon cl;ose of the radwindow I need the page to refresh itself by calling my page load sub so this way the changes they made in the radwindow are reflected on the page.  How can I do this?  Thank you
Shinu
Top achievements
Rank 2
 answered on 27 Sep 2013
3 answers
101 views

Having some difficulties working with the MasterTable and the DetailTable within my Grid.  I have it to the point I would like it but need some minor adjustments and I believe I have what I am looking for.
How do I get the CartID from the MasterTable passed to my DetailTable Datasource. 

<telerik:RadGrid ID="_grdHistory" runat="server" AutoGenerateColumns="False"
                    CellSpacing="0" GridLines="None">
                    <MasterTableView>
                    <DetailTables>
                    <telerik:GridTableView DataKeyNames="CartID" DataSourceID="SqlDataSource3" Width="100%" runat="server" EnableHeaderContextMenu="false">
                        <ParentTableRelation>
                            <telerik:GridRelationFields DetailKeyField="CartID" MasterKeyField="CartID">
                            </telerik:GridRelationFields>
                        </ParentTableRelation>
                        <Columns>
                            <telerik:GridBoundColumn SortExpression="CartID" HeaderText="CartID" DataField="CartID" UniqueName="CartID" Display="True">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="ItemName" HeaderText="Item Name" DataField="ItemName" UniqueName="ItemName">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="ItemCnt" HeaderText="Item Cnt" DataField="ItemCnt" UniqueName="ItemCnt">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="TotItemCost" HeaderText="Item Cnt" DataField="TotItemCost" UniqueName="TotItemCost">
                            </telerik:GridBoundColumn>
                        </Columns>
                    </telerik:GridTableView>
 
                    </DetailTables>
 
 
                    <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                    <HeaderStyle Width="20px"></HeaderStyle>
                    </RowIndicatorColumn>
 
                    <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                    <HeaderStyle Width="20px"></HeaderStyle>
                    </ExpandCollapseColumn>
 
                        <Columns>
                            <telerik:GridHyperLinkColumn AllowSorting="False"
                                FilterControlAltText="Filter InvoiceID column" HeaderText="INVOICE #"
                                UniqueName="InvoiceID" DataNavigateUrlFields="InvoiceID"
                                DataNavigateUrlFormatString="OrderHistoryDetail.aspx?ID={0}"
                                DataTextField="InvoiceID" Target="_blank">
                            </telerik:GridHyperLinkColumn>
                            <telerik:GridBoundColumn DataField="Order_Date"
                                FilterControlAltText="Filter column1 column" HeaderText="ORDER DATE"
                                UniqueName="column1" DataFormatString="{0:MM/dd/yyyy}">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Order_Amt"
                                FilterControlAltText="Filter column1 column" HeaderText="ORDER AMOUNT"
                                UniqueName="column1" DataFormatString="{0:c}" ItemStyle-HorizontalAlign="Right">
                                <ItemStyle HorizontalAlign="Right"></ItemStyle>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="OrderedByName"
                                FilterControlAltText="Filter column1 column" HeaderText="ORDERED BY"
                                UniqueName="column1">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Shipped"
                                FilterControlAltText="Filter column1 column" HeaderText="SHIPPED"
                                UniqueName="column1" DataFormatString="{0:MM/dd/yyyy}">
                            </telerik:GridBoundColumn>
                            <telerik:GridHyperLinkColumn AllowSorting="False" DataTextField="FedExTrack"
                                DataNavigateUrlFields="FedExTrack"
                                FilterControlAltText="Filter column3 column"
                                ImageUrl="~/images/FedEx-Shipping-Box-icon.png"
                                DataNavigateUrlFormatString="http://www.fedex.com/Tracking?action=track&;tracknumbers={0}"
                                UniqueName="FedExTrack" Target="_blank">
                            </telerik:GridHyperLinkColumn>
                            <telerik:GridBoundColumn DataField="Approved"
                                FilterControlAltText="Filter column1 column" 
                                UniqueName="Approved" ItemStyle-HorizontalAlign="Right" Display="False">
                                <ItemStyle HorizontalAlign="Right"></ItemStyle>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="CartID"
                                FilterControlAltText="Filter CartID column" 
                                UniqueName="CartID" ItemStyle-HorizontalAlign="Right" Display="False">
                                <ItemStyle HorizontalAlign="Right"></ItemStyle>
                            </telerik:GridBoundColumn>
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>
            </td></tr>
            </table>
        </td>
    </tr>
</table>
                    <asp:SqlDataSource ID="SqlDataSource3" ConnectionString="<%$ ConnectionStrings:PHConn %>"
                        SelectCommand="sp_getCartDetail" SelectCommandType="StoredProcedure"
                        runat="server">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="_grdHistory" Name="CartID"
                                PropertyName="SelectedValue" Type="Int32" />
                        </SelectParameters>
                    </asp:SqlDataSource>

Also what I would like to do is if column "Approved" is NULL/blank then change the 1st column to "Pending".  Likewise with FedExTrack, I would like to show it as blank and not show the image.  How can I go about accomplishing these two items.  Below is the code I started with but when I added the DetailTable it broke my logic.

Sub PopulateData()
    Try
        oConn.Open()
        Dim ocmd As New SqlCommand("sp_getOrderHistoryFilter", oConn)
        ocmd.CommandType = CommandType.StoredProcedure
        With ocmd.Parameters
            .Add(New SqlParameter("@asi_num", Session("asi_num")))
            .Add(New SqlParameter("@Date1", DBNull.Value))
            .Add(New SqlParameter("@Date2", DBNull.Value))
            .Add(New SqlParameter("@Area", DBNull.Value))
        End With
        reader = ocmd.ExecuteReader()
        Me._grdHistory.DataSource = reader
        Me._grdHistory.DataBind()
    Catch ex As Exception
 
    Finally
        oConn.Close()
    End Try
End Sub
 
Private Sub _grdHistory_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles _grdHistory.ItemDataBound
    If TypeOf e.Item Is GridDataItem Then
        'This does not appear to be working at this time.
        'Purpose is to display different text if the order has not been approved yet
        'If e.Item.Cells(8).Text = " " Then
        '    e.Item.Cells(1).Text = "Pending"
        '    e.Item.Cells(1).Font.Italic = True
        'End If
 
        'If e.Item.Cells(6).Text = " " Then 'Hide Shipping if there is no data
        '    e.Item.Cells(7).Text = ""
        'End If
    End If
 
End Sub







Princy
Top achievements
Rank 2
 answered on 27 Sep 2013
7 answers
179 views
I am throwing my arms up in the air.

I have a radwindow set to autosize. I have a fixed width and height div on my page. Sometimes the window opens correct, other times it opens with scroll bars. Please see attached images of me opening the exact item. (Ignore radwindow.png) Sometimes its right, sometimes not.

There does not seem to be any rhyme or reason for this. I really need help because I have to deliver this to the client 2 weeks ago.

Thanks


(btw, how do you delete a file from a post once its uploaded?)




Kim
Top achievements
Rank 1
 answered on 27 Sep 2013
3 answers
124 views

i had used GridGroupByField to display some information in group header.

as i need to add a checkbox to select all node/row, i had added a checkbox column in groupheadertemplate

but all the information in group header disappear after add the groupheadertemplate.

how can i solve it ? thanks.

               <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" 
                    AllowMultiRowSelection="True" AllowPaging="True" AllowSorting="True" 
                    AutoGenerateColumns="False" CellSpacing="0" DataSourceID="ldsPayrollFlow" 
                    EnableAJAX="true" EnableAJAXLoadingTemplate="true" GridLines="None" 
                    LoadingTemplateTransparency="25" PageSize="100" Width="1180px">
  
                    <PagerStyle Mode="NumericPages"></PagerStyle>
                                   
                    <mastertableview datakeynames="SID" datasourceid="ldsPayrollFlow" 
                    grouploadmode="Client">
                        <commanditemsettings exporttopdftext="Export to Pdf"></commanditemsettings>
                        <rowindicatorcolumn>
                            <HeaderStyle Width="10px"></HeaderStyle>
                  
                        </rowindicatorcolumn>
                        <expandcollapsecolumn>
                            <HeaderStyle Width="10px"></HeaderStyle>
                  
                        </expandcollapsecolumn>
  
                        <groupbyexpressions>                                               
                        <telerik:GridGroupByExpression
                            <selectfields
                                <telerik:GridGroupByField FieldAlias="DisplayName" 
                                FieldName="DisplayName" HeaderText="Staff Name" HeaderValueSeparator="  : "></telerik:GridGroupByField
                            </selectfields
                            <groupbyfields
                                <telerik:GridGroupByField FieldName="DisplayName"></telerik:GridGroupByField
                            </groupbyfields>                         
                            </telerik:GridGroupByExpression
                        </groupbyexpressions
  
                        <groupheadertemplate>
                            <asp:CheckBox ID="GroupHeaderCheckBox" runat="server" 
                            OnClick="GroupToggleSelection(this);" ToggleType="CheckBox" ToolTip ="Select this staff">
                            </asp:CheckBox>     
                            <asp:Label ID="lb_staff_detail" runat="server" Text=""></asp:Label>                                                                                              
                        </groupheadertemplate>
  
                        <Columns>
  
                            <telerik:GridBoundColumn DataField="SID" HeaderText="SID" ReadOnly="True" 
                                SortExpression="SID" UniqueName="SID" Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn AllowFiltering="true" DataField="StaffNo" 
                                HeaderStyle-Width="100" HeaderText="Staff Number" ReadOnly="True" 
                                SortExpression="StaffNo" UniqueName="StaffNo">
                                <ItemStyle BackColor="White" BorderColor="ActiveBorder" 
                                Font-Underline="false" ForeColor="Black" />
                            </telerik:GridBoundColumn>                            
                            <telerik:GridBoundColumn AllowFiltering="true" DataField="DisplayName" 
                                HeaderStyle-Width="100" HeaderText="Staff Name" ReadOnly="True" 
                                SortExpression="DisplayName" UniqueName="DisplayName"><ItemStyle 
                                BackColor="White" BorderColor="ActiveBorder" Font-Underline="false" 
                                ForeColor="black" />
                            </telerik:GridBoundColumn>                            
                            <telerik:GridBoundColumn AllowFiltering="true" DataField="Department" 
                                HeaderStyle-Width="100" HeaderText="Department" ReadOnly="True" 
                                SortExpression="Department" UniqueName="Department">
                                <ItemStyle BackColor="White" BorderColor="ActiveBorder" 
                                Font-Underline="false" ForeColor="Black" />
                            </telerik:GridBoundColumn>                            
                            <telerik:GridBoundColumn AllowFiltering="true" DataField="BasicSalaryMonthly" ItemStyle-CssClass="cellalignRight"
                                DataFormatString="{0:G}" HeaderStyle-Width="100" HeaderText="Basic Salary" ItemStyle-HorizontalAlign="Right" 
                                ReadOnly="True" SortExpression="BasicSalaryMonthly" 
                                UniqueName="BasicSalaryMonthly"><ItemStyle BackColor="White" 
                                BorderColor="ActiveBorder" Font-Underline="false" ForeColor="Black" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn AllowFiltering="true" DataField="AllowanceName" 
                                HeaderStyle-Width="150" HeaderText="Allowance Name" ReadOnly="True" 
                                SortExpression="AllowanceName" UniqueName="AllowanceName"><ItemStyle 
                                BackColor="White" BorderColor="ActiveBorder" Font-Underline="false" 
                                ForeColor="Black" />
                            </telerik:GridBoundColumn>                            
                            <telerik:GridBoundColumn AllowFiltering="true" DataField="AllowanceAmount" 
                                DataFormatString="{0:G}" HeaderStyle-Width="100" HeaderText="Amount" ItemStyle-HorizontalAlign="Right"
                                ReadOnly="True" SortExpression="AllowanceAmount" UniqueName="AllowanceAmount"><ItemStyle 
                                BackColor="White" BorderColor="ActiveBorder" Font-Underline="false" 
                                ForeColor="Black" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn AllowFiltering="true" DataField="UpdateDate" DataFormatString="{0:dd-MMM-yyyy}" 
                                HeaderStyle-Width="100" HeaderText="Last Updated Date" ReadOnly="True" DataType="System.DateTime" 
                                SortExpression="UpdateDate" UniqueName="UpdateDate"><ItemStyle 
                                BackColor="White" BorderColor="ActiveBorder" Font-Underline="false" 
                                ForeColor="Black" />
                            </telerik:GridBoundColumn>                            
                            <telerik:GridBoundColumn AllowFiltering="true" DataField="FlowDate" DataFormatString="{0:dd-MMM-yyyy}" 
                                HeaderStyle-Width="100" HeaderText="Last Flow Date" ReadOnly="True" DataType="System.DateTime" 
                                SortExpression="FlowDate" UniqueName="FlowDate"><ItemStyle 
                                BackColor="White" BorderColor="ActiveBorder" Font-Underline="false" 
                                ForeColor="Black" />
                            </telerik:GridBoundColumn>                            
                            <telerik:GridClientSelectColumn Display="false" HeaderStyle-Width="10" 
                                UniqueName="ClientSelectColumn" Visible="true"
                                </telerik:GridClientSelectColumn>
  
  
                            </Columns>
                  
                    </mastertableview>
                                <clientsettings>
                <selecting allowrowselect="true"></selecting>
                <ClientEvents OnRowSelecting="Selecting" />
<%--                <resizing allowcolumnresize="True" allowrowresize="True" 
                    enablerealtimeresize="True" resizegridoncolumnresize="False"></resizing>--%>
            </clientsettings>
                </telerik:RadGrid>
Shinu
Top achievements
Rank 2
 answered on 27 Sep 2013
7 answers
437 views
I have a grid and a telerik button.  When I click the button I want a Save As prompt dialog to appear so the user can change the file name and save the file locally to whichever destination they choose.  But when I click on my button nothing happens?  I am testing this through localhost\ does this function not work unless its run from the actual server? Or should it behave the same even when running from localhost? Here is a copy of my grid.

                                                  <telerik:RadAjaxPanel ID="pnlUpload" runat="server" height="580px" width="980px" LoadingPanelID="lpnUpload">  

  <telerik:RadButton ID="cmdExportPayrolFile" runat="server" Enabled="False" Skin="Metro" Text="Export Payroll File">
                                                    </telerik:RadButton>

<telerik:RadGrid ID="dgExportReport" runat="server" AllowPaging="True" AutoGenerateColumns="False" CellSpacing="0" GridLines="None" Skin="Sitefinity" Width="100%">
                                            <ExportSettings>
                                                <Csv ColumnDelimiter="Comma"
                                                     RowDelimiter="NewLine"
                                                     EncloseDataWithQuotes="False"
                                                     FileExtension ="txt"
                                                 />
                                            </ExportSettings>
                                            <MasterTableView PageSize="15">
                                                <Columns>
                                                    <telerik:GridBoundColumn DataField="EmplID" FilterControlAltText="" HeaderText="Emp Id" UniqueName="dgEmplID">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn DataField="FullName" FilterControlAltText="" HeaderText="Employee" UniqueName="dgLastName">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn DataField="CostCenterID" FilterControlAltText="" HeaderText="Cost Center" UniqueName="dgCostCenter">
                                                        <ItemStyle HorizontalAlign="Right" />
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn DataField="Total" DataFormatString="{0:$###,##0.00}" FilterControlAltText="" HeaderText="Total" UniqueName="dgTotal">
                                                        <ItemStyle HorizontalAlign="Right" />
                                                    </telerik:GridBoundColumn>
                                                </Columns>
                                                <PagerStyle PageSizeControlType="RadComboBox" />
                                            </MasterTableView>
                                            <PagerStyle PageSizeControlType="RadComboBox" />
                                            <FilterMenu EnableImageSprites="False">
                                            </FilterMenu>
                                        </telerik:RadGrid>
        </telerik:RadAjaxPanel>

========================
VB CODE BEHIND
=========================

    Protected Sub cmdExportPayrolFile_Click(sender As Object, e As EventArgs) Handles cmdExportPayrolFile.Click

        dgExportReport.MasterTableView.ExportToCSV()

    End Sub


Am I missing something in the grid properties? Does this feature only work if the page is run from the server and NOT localhost? I am populating the grid using advanced binding upon a combo box select index changed.

Thanks


Princy
Top achievements
Rank 2
 answered on 27 Sep 2013
1 answer
523 views
HI

   I have a master-detail rad grid - with data set. Autogenerate columns is off. It is autogenerating columns.
So now I have duplicate columns.

protected void Page_Load(object sender, EventArgs e)

{

if (!IsPostBack)

Setup();

}

protected void Setup()

{

DataTable oTableParent = new DataTable("Parent");

oTableParent.Columns.Add("PKey", Type.GetType("System.Int32"));

oTableParent.Columns.Add("Code", Type.GetType("System.String"));

oTableParent.Columns.Add("Description", Type.GetType("System.String"));

oTableParent.Rows.Add(1,"AAAAA","aaaaaaaaaaaaaaa");

oTableParent.Rows.Add(2,"BBBBB","bbbbbbbbbbbbbbb");

DataTable oTableChild = new DataTable("Child");

oTableChild.Columns.Add("ChildPKey", Type.GetType("System.Int32"));

oTableChild.Columns.Add("PKey", Type.GetType("System.Int32"));

oTableChild.Columns.Add("Code", Type.GetType("System.String"));

oTableChild.Columns.Add("Description", Type.GetType("System.String"));

oTableChild.Rows.Add(1,1, "AAAA-A", "aaaaaaaaaaaaaaa");

oTableChild.Rows.Add(2,1, "AAAA-B", "aaaaaaabbbbbbbb");

oTableChild.Rows.Add(3, 2, "BBBB-A", "bbbbbbbbaaaaaaa");

oTableChild.Rows.Add(4, 2, "BBBB-B", "bbbbbbbbbbbbbbb");

DataColumn[] oKeys = new DataColumn[1];

oKeys[0] = oTableParent.Columns[0];

oTableParent.PrimaryKey = oKeys;

DataSet oDS = new DataSet();

oDS.Tables.Add(oTableParent);

oDS.Tables.Add(oTableChild);

oDS.Relations.Add("Primary", oDS.Tables[0].Columns[0], oDS.Tables[1].Columns[1]);

RadGrid1.AutoGenerateColumns = false;

RadGrid1.DataSource = oDS;

RadGrid1.DataBind();

}


<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AutoGenerateColumns="False" CellSpacing="0" GridLines="None" Height="181px" Width="1091px" AllowSorting="True" DataMember="Parent">

<ClientSettings>

<Selecting AllowRowSelect="True" />

</ClientSettings>

<MasterTableView HierarchyLoadMode="ServerBind" AutoGenerateColumns="True" DataKeyNames="PKey" DataMember="Parent">

<DetailTables>

<telerik:GridTableView runat="server" AutoGenerateColumns="True" AllowSorting="False" DataMember="Child">

<%-- <ParentTableRelation>

<telerik:GridRelationFields DetailKeyField="PKey" MasterKeyField="PKey" />

</ParentTableRelation>--%>

<ParentTableRelation>

<telerik:GridRelationFields DetailKeyField="PKey" MasterKeyField="PKey" />

</ParentTableRelation>

<Columns>

<telerik:GridBoundColumn FilterControlAltText="Filter ChildPKey column" UniqueName="ChildPKey" DataType="System.Int32" HeaderText="ChildPKey" ReadOnly="True">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn DataField="PKey" FilterControlAltText="Filter PKey column" HeaderText="PKey" UniqueName="PKeyChild" DataType="System.Int32">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn DataField="Code" FilterControlAltText="Filter Code column" HeaderText="Code" UniqueName="CodeChild">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn DataField="Description" FilterControlAltText="Filter Description column" HeaderText="Description" UniqueName="DescriptionChild">

</telerik:GridBoundColumn>

</Columns>

</telerik:GridTableView>

</DetailTables>

<Columns>

<telerik:GridBoundColumn DataField="PKey" FilterControlAltText="Filter PKey column" HeaderText="PKey" UniqueName="PKey" DataType="System.Int32">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn DataField="Code" FilterControlAltText="Filter Code column" HeaderText="Code" UniqueName="Code">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn DataField="Description" FilterControlAltText="Filter Description column" HeaderText="Description" UniqueName="Description">

</telerik:GridBoundColumn>

<telerik:GridCheckBoxColumn DataType="System.Boolean" FilterControlAltText="Filter column column" UniqueName="column">

</telerik:GridCheckBoxColumn>

</Columns>

</MasterTableView>

</telerik:RadGrid>

Gary

Princy
Top achievements
Rank 2
 answered on 27 Sep 2013
8 answers
616 views
Is there any way of restricting the maximum width and height of images that people can use within the RadEditor?  Both at the point of upload and within the designer would be useful.

Users can upload images but some are uploading images that are far too large (dimensions) and they are breaking the layout of the page.

I think that one partial solution would be to override the save function in the image manager to resize the graphic but the user could still use the design view of the editor to drag the image to a size that is too large.

Thanks

Marco Antonio
Top achievements
Rank 1
 answered on 26 Sep 2013
0 answers
86 views
Hi,
I am using multiple RadGrid in the same page, when AddNew in one grid is kept open, and then at the sametime AddNew in second grid is not working.

Can anyone help me in solving this issue.

asp Code:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="grdSoftware">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="grdSoftware" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="grdCategory">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="grdCategory" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
 </telerik:RadAjaxManager>
 
   <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="WebBlue">
            </telerik:RadAjaxLoadingPanel>
 
<telerik:RadPanelBar ID="RadPanelBar1" runat="server" Width="980" ExpandMode="SingleExpandedItem" onclientitemcollapse="OnClientItemCollapse">
                <CollapseAnimation Type="Linear" Duration="500" />
                <Items>
<telerik:RadPanelItem Expanded="false" Text="Software Description">
                        <ContentTemplate>
                            <telerik:RadGrid ID="grdSoftware" runat="server" AllowFilteringByColumn="True" AllowPaging="True"
                                AllowSorting="True" AutoGenerateColumns="False" AllowAutomaticUpdates="false"
                                AutoGenerateDeleteColumn="True" AllowAutomaticInserts="false" ShowStatusBar="True"
                                OnPreRender="grdSoftware_OnPreRender" OnItemDataBound="grdSoftware_ItemDataBound"
                                OnItemCreated="grdSoftware_ItemCreated" OnItemCommand="grdSoftware_OnItemCommand"
                                VirtualItemCount="50000" PageSize="5" GridLines="None" DataSourceID="dsSoftware"
                                OnInsertCommand="grdSoftware_OnInsertCommand" OnUpdateCommand="grdSoftware_OnUpdateCommand"
                                OnDeleteCommand="grdSoftware_OnDeleteCommand">
                                  <MasterTableView AllowMultiColumnSorting="true" CommandItemDisplay="Top" DataKeyNames="SofwareId"
                                    DataSourceID="dsSoftware">
                                    <CommandItemSettings ExportToPdfText="Export to Pdf" AddNewRecordText="Add New" AddNewRecordImageUrl="Images/AddNew.ico">
                                    </CommandItemSettings>
                                    <RowIndicatorColumn>
                                        <HeaderStyle Width="20px"></HeaderStyle>
                                    </RowIndicatorColumn>
                                    <ExpandCollapseColumn Visible="true">
                                        <HeaderStyle Width="20px"></HeaderStyle>
                                    </ExpandCollapseColumn>
                                    <Columns>
                                        <telerik:GridEditCommandColumn />
                                        <telerik:GridBoundColumn DataField="SofwareId" DataType="System.Int32" HeaderText="SofwareId"
                                            ReadOnly="True" SortExpression="SofwareId" Visible="false" UniqueName="SofwareId">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="SoftwareName" HeaderText="SoftwareName" SortExpression="SoftwareName"
                                            UniqueName="SoftwareName">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="Description" HeaderText="Description" Visible="false"
                                            SortExpression="Description" UniqueName="Description">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridCheckBoxColumn DataField="IsActive" DataType="System.Boolean" HeaderText="IsActive"
                                            SortExpression="IsActive" UniqueName="IsActive">
                                        </telerik:GridCheckBoxColumn>
                                    </Columns>
          <EditFormSettings EditFormType="Template">
                                        <FormTemplate>
                                            <fieldset>
                                                <table>
                                                    <tbody>
                                                        <tr>
                                                            <td>
                                                                Software Name :
                                                            </td>
                                                            <td>
                                                                <asp:TextBox ID="txtSoftwareName" Text='<%#Bind("SoftwareName") %>' runat="server"></asp:TextBox>
                                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="* Required"
                                                                    ControlToValidate="txtSoftwareName"></asp:RequiredFieldValidator>
                                                            </td>
                                                            <td>
                                                            </td>
                                                            <td>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                Description :
                                                            </td>
                                                            <td>
                                                                <asp:TextBox ID="txtDescription" Text='<%#Bind("Description") %>' runat="server"></asp:TextBox>
                                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="* Required"
                                                                    ControlToValidate="txtDescription"></asp:RequiredFieldValidator>
                                                            </td>
                                                            <td>
                                                            </td>
                                                            <td>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                Is Active :
                                                            </td>
                                                            <td>
                                                                <asp:CheckBox ID="chkIsActive" Checked='<%# Eval("IsActive") == DBNull.Value? true : Eval("IsActive") %>'
                                                                    runat="server"></asp:CheckBox>
                                                            </td>
                                                            <td>
                                                            </td>
                                                            <td>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                                <table style="width: 100%">
                                                    <tr>
                                                        <td align="right" colspan="2">
                                                            <asp:Button ID="Button1" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                                                runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
                                                            </asp:Button
                                                            <asp:Button ID="Button2" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel">
                                                            </asp:Button>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </fieldset>
                                        </FormTemplate>
                                        <PopUpSettings Modal="true" Width="600" />
                                    </EditFormSettings>
                                    <PagerStyle AlwaysVisible="True" />
                                </MasterTableView>
                                <PagerStyle AlwaysVisible="True" />
                            </telerik:RadGrid>
                            <asp:SqlDataSource ID="dsSoftware" runat="server" ConnectionString="<%$ ConnectionStrings:TestConnectionString %>"
                                SelectCommand="SELECT [SofwareId], [SoftwareName], [Description], [IsActive] FROM [SoftwareDetails]">
                            </asp:SqlDataSource>
                        </ContentTemplate>
                    </telerik:RadPanelItem>
 
 <telerik:RadPanelItem Expanded="false" Text="Exam Categories">
                        <ContentTemplate>
                            <telerik:RadGrid ID="grdCategory" runat="server" AllowFilteringByColumn="True" AllowPaging="True"
                                AllowSorting="True" AutoGenerateColumns="False" AutoGenerateDeleteColumn="True"
                                AllowAutomaticInserts="false" AllowAutomaticUpdates="false" ShowStatusBar="True"
                                OnItemDataBound="grdCategory_OnItemDataBound" VirtualItemCount="50000" PageSize="5"
                                OnItemCreated="grdCategory_ItemCreated" OnPreRender="grdCategory_OnPreRender"
                                GridLines="None" DataSourceID="CategoryDatasource" OnInsertCommand="grdCategory_OnInsertCommand"
                                OnUpdateCommand="grdCategory_OnUpdateCommand" OnDeleteCommand="grdCategory_OnDeleteCommand"
                                OnItemCommand="grdCategory_OnItemCommand">
                                <MasterTableView AllowMultiColumnSorting="true" CommandItemDisplay="Top" DataKeyNames="CategroyId"
                                    DataSourceID="CategoryDatasource">
                                    <CommandItemSettings ExportToPdfText="Export to Pdf" AddNewRecordText="Add New" AddNewRecordImageUrl="Images/AddNew.ico">
                                    </CommandItemSettings>
                                    <Columns>
                                        <telerik:GridEditCommandColumn />
                                        <telerik:GridBoundColumn DataField="CategroyId" DataType="System.Int32" HeaderText="CategroyId"
                                            ReadOnly="True" SortExpression="CategroyId" UniqueName="CategroyId" Visible="False">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridTemplateColumn DataField="CategroyName" HeaderText="Categroy Name" SortExpression="CategroyName"
                                            UniqueName="CategroyName">
                                            <ItemTemplate>
                                                <asp:Label runat="server" ID="temp1" Text='<%#Bind("CategroyName") %>' />
                                            </ItemTemplate>
                                            <EditItemTemplate>
                                                <asp:TextBox ID="txtCategoryName" runat="server" Text='<%#Bind("CategroyName") %>' />
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="*Required"
                                                    ControlToValidate="txtCategoryName"></asp:RequiredFieldValidator>
                                            </EditItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn DataField="SoftwareId" DataType="System.Int32" HeaderText="Software"
                                            SortExpression="SoftwareId" UniqueName="SoftwareId" Visible="False">
                                            <ItemTemplate>
                                                <asp:Label ID="Label21" runat="server" Text='<%# Bind( "SoftwareId") %>' />
                                            </ItemTemplate>
                                            <EditItemTemplate>
                                                <asp:DropDownList ID="cmbSoftwareCategory" runat="server" DataSourceID="SqlDataSourceforSoftwareCategory"
                                                    Width="310px" DataValueField="SofwareId" DataTextField="SoftwareName" />
                                                <%--SelectedValue='<%# Bind( "SoftwareId") %>'--%>
                                            </EditItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridBoundColumn DataField="SoftwareName" HeaderText="Software Name" SortExpression="SoftwareName"
                                            ReadOnly="true" UniqueName="SoftwareName">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridTemplateColumn DataField="Description" HeaderText="Description" SortExpression="Description"
                                            UniqueName="Description" Visible="False">
                                            <ItemTemplate>
                                                <asp:Label ID="Label25" runat="server" Text='<%#Bind("Description") %>' />
                                            </ItemTemplate>
                                            <EditItemTemplate>
                                                <asp:TextBox ID="txtDescription" runat="server" Text='<%#Bind("Description") %>' />
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ErrorMessage="*Required"
                                                    ControlToValidate="txtDescription"></asp:RequiredFieldValidator>
                                            </EditItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn DataField="IsActive" DataType="System.Boolean" HeaderText="IsActive"
                                            SortExpression="IsActive" UniqueName="IsActive" Visible="False">
                                            <ItemTemplate>
                                            </ItemTemplate>
                                            <EditItemTemplate>
                                                <asp:CheckBox ID="chkActive" runat="server" Checked='<%# Eval("IsActive") == DBNull.Value? true : Eval("IsActive") %>' />
                                            </EditItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn DataField="ExamName" HeaderText="ExamName" SortExpression="ExamName"
                                            UniqueName="ExamName" Visible="False">
                                            <ItemTemplate>
                                            </ItemTemplate>
                                            <EditItemTemplate>
                                                <asp:DropDownList ID="cmbExamCategory" runat="server" DataSourceID="SqlDataSourceforExamCategory"
                                                    Width="310px" DataValueField="ExamId" DataTextField="ExamName" />
                                                <%-- SelectedValue='<%# Bind( "ExamId") %>'--%>
                                            </EditItemTemplate>
                                        </telerik:GridTemplateColumn>
                                    </Columns>
                                    <EditFormSettings>
                                        <EditColumn ButtonType="PushButton" HeaderStyle-HorizontalAlign="Right">
                                            <HeaderStyle HorizontalAlign="Right"></HeaderStyle>
                                        </EditColumn>
                                    </EditFormSettings>
                                    <PagerStyle AlwaysVisible="True" />
                                </MasterTableView>
                                <PagerStyle AlwaysVisible="True" />
                            </telerik:RadGrid>
                            <asp:SqlDataSource ID="CategoryDatasource" runat="server" ConnectionString="<%$ ConnectionStrings:TestConnectionString  %>"
                                SelectCommand="SELECT CategoryDetails.CategroyId, CategoryDetails.CategroyName, CategoryDetails.SoftwareId, SoftwareDetails.SoftwareName, CategoryDetails.Description, CategoryDetails.IsActive, ExamDetails.ExamId, ExamDetails.ExamName FROM CategoryDetails INNER JOIN SoftwareDetails ON CategoryDetails.SoftwareId = SoftwareDetails.SofwareId INNER JOIN ExamDetails ON CategoryDetails.ExamId = ExamDetails.ExamId">
                            </asp:SqlDataSource>
                            <asp:SqlDataSource ID="SqlDataSourceforSoftwareCategory" runat="server" ConnectionString="<%$ ConnectionStrings:TestConnectionString  %>"
                                SelectCommand="SELECT SofwareId, SoftwareName FROM SoftwareDetails"></asp:SqlDataSource>
                            <asp:SqlDataSource ID="SqlDataSourceforExamCategory" runat="server" ConnectionString="<%$ ConnectionStrings:TestConnectionString  %>"
                                SelectCommand="SELECT ExamId, ExamName FROM ExamDetails"></asp:SqlDataSource>
                        </ContentTemplate>
                    </telerik:RadPanelItem>
</Items>
</telerik:RadPanelBar >

Chockalingam
Top achievements
Rank 1
 asked on 26 Sep 2013
2 answers
79 views
Hello,

I created a GridTemplateColumn and placed a table inside with rows and columns. For some reason i'm getting a light blue bar next to each row that i would like to get rid of. Only appears on white backgrounds. Second, the spacing of each row is huge, I tried to change the padding and spacing in the table, i tried a couple CSS rules but nothing works. I'm thinking its the grid spacing them out. How do i close the gab?.

Attached is a snapshot of what I'm seeing and the code i used to create the GridTemplateColumn.

<telerik:GridTemplateColumn DataField="DETAIL" UniqueName="DetailColumn" HeaderStyle-Width="700px">
    <ItemTemplate>
        <asp:Panel ID="Panel1" runat="server">
            <table cellpadding="0" cellspacing="0" style="font-size:9px;">
                <tr>
                    <td valign="top" style="width:80px;"><b>Projected :</b></td>
                    <td valign="top" style="width:50px;"><%# Eval("PROJECTED") %></td>
                    <td valign="top" style="width:80px;"><b>ACD Calls :</b></td>
                    <td valign="top" style="width:50px;"><%# Eval("ACD_CALLS") %></td>
                    <td valign="top" style="width:80px;"><b>Aban Calls :</b></td>
                    <td valign="top" style="width:50px;"><%# Eval("ABAN_CALLS") %></td>
                </tr>
                <tr>
                    <td valign="top" style="width:80px;"><b>Forcasted :</b></td>
                    <td valign="top" style="width:50px;"><%# Eval("PROJECTED") %></td>
                    <td valign="top" style="width:80px;"><b>ACD Time :</b></td>
                    <td valign="top" style="width:50px;"><%# Eval("ACD_CALLS") %></td>
                    <td valign="top" style="width:80px;"><b>Aban Time :</b></td>
                    <td valign="top" style="width:50px;"><%# Eval("ABAN_CALLS") %></td>
                </tr>
                <tr>
                    <td valign="top" style="width:80px;"><b>Offered :</b></td>
                    <td valign="top" style="width:50px;"><%# Eval("PROJECTED") %></td>
                    <td valign="top" style="width:80px;"><b>ASA :</b></td>
                    <td valign="top" style="width:50px;"><%# Eval("ACD_CALLS") %></td>
                    <td valign="top" style="width:80px;"><b>Aban Rate :</b></td>
                    <td valign="top" style="width:50px;"><%# Eval("ABAN_CALLS") %></td>
                </tr>
                <tr>
                    <td valign="top" style="width:80px;"><b>Service Level :</b></td>
                    <td valign="top" style="width:50px;"><%# Eval("PROJECTED") %></td>
                    <td valign="top" style="width:80px;"><b></b></td>
                    <td valign="top" style="width:50px;"></td>
                    <td valign="top" style="width:80px;"><b>Hold Aban Calls :</b></td>
                    <td valign="top" style="width:50px;"></td>
                </tr>
            </table>
        </asp:Panel>
    </ItemTemplate>
</telerik:GridTemplateColumn>

Thanks!
Shane
Shane
Top achievements
Rank 1
 answered on 26 Sep 2013
9 answers
507 views
Hi,

I am dumping the contents of the rad grid into a data table and am trying to find a control that is inside the item template of a grid template column without knowing what he control name is.

I am  looping through all the columns in the grid and based on the data type, performing some custom formatting before inserting the row into the data table.

My question is, if the column is a grid template column, how can I find the control that is inside the <Item Template> without actually knowing the name.

Below is the code I am using to loop through the grid.
Dim dr As DataRow
 For Each dataItem As GridDataItem In Me.rgvMainGrid.MasterTableView.Items
     dr = exportTable.NewRow
     For Each column As GridColumn In Me.rgvMainGrid.MasterTableView.Columns
         If column.Display = True Then
             Select Case column.ColumnType
                 Case "GridBoundColumn", "GridDropDownColumn", "GridDateTimeColumn", "GridNumericColumn", "GridCalculatedColumn"
                     strFields = strFields + IIf(strFields = Nothing, "", ",") + column.UniqueName.ToString + "," + column.HeaderText.ToString
                     Select Case column.DataType.ToString
                         Case "System.String"
                             If dataItem(column.UniqueName).Text.ToString = " " Then
                                 dr(column.UniqueName) = ""
                             Else
                                 dr(column.UniqueName) = "'" + dataItem(column.UniqueName).Text.ToString
                             End If
                         Case "System.Decimal", "System.Double", "System.Single"
                             If dataItem(column.UniqueName).Text.ToString = " " Then
                                 dr(column.UniqueName) = 0
                             Else
                                 dr(column.UniqueName) = FormatNumber(dataItem(column.UniqueName).Text.ToString, 2, TriState.False, TriState.False, TriState.False)
                             End If
                         Case "System.Int16", "System.Int32", "System.Int64", "System.Single"
                             If dataItem(column.UniqueName).Text.ToString = " " Then
                                 dr(column.UniqueName) = 0
                             Else
                                 dr(column.UniqueName) = FormatNumber(dataItem(column.UniqueName).Text.ToString, 0, TriState.False, TriState.False, TriState.False)
                             End If
                         Case "System.DateTime"
                             If dataItem(column.UniqueName).Text.ToString = " " Then
                                 dr(column.UniqueName) = ""
                             Else
                                 dr(column.UniqueName) = dataItem(column.UniqueName).Text.ToString
                             End If
                     End Select
                 Case "GridTemplateColumn"
 
                 Case Else
                     'Do Nothing
             End Select
         End If
 
     Next
     exportTable.Rows.Add(dr)
 Next

Thanks for your assistance.
Tracy
Tracy
Top achievements
Rank 1
 answered on 26 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?