Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
71 views
Hi

I have implemented some custom code (which came from elsewhere on the site) as I want the data in the headers to appear over the relevant column.  I get a problem when using the Frozen columns feature in that after horizontally scrolling to the right and then back to the left the contents of the columns shifts to the right.  I've posted a couple of screenshots below.  I can see that a colspan is added to the first column in the header row as the view is scrolled back.  Anyone seen this before? 

Versions are : asp.net 4.0, Windows 7, I.E. 8.0.7601.17514, RadGrid 2012.3.1308.40.

Thanks

Before


After


Code for setting up the group header:

protected void RadGrid_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridGroupHeaderItem)
        {
            (e.Item as GridGroupHeaderItem).DataCell.Visible = false;
            e.Item.PreRender += new EventHandler(Item_PreRender);
        }
    }
 
    void Item_PreRender(object sender, EventArgs e)
    {
        GridGroupHeaderItem groupHeader = sender as GridGroupHeaderItem;
 
        if (groupHeader != null)
        {
            for (int i = 3; i < groupHeader.OwnerTableView.RenderColumns.Length; i++)
            {
                if (groupHeader.OwnerTableView.RenderColumns[i].UniqueName == "ColumnOne")
                {                   
                    groupHeader.Cells[i - 1].Text = string.Format("<nobr>{0}</nobr>", "One");
                }
                else if (groupHeader.OwnerTableView.RenderColumns[i].UniqueName == "ColumnTwo")
                {
                    groupHeader.Cells[i - 1].Text = "Two";
                }
                else if (groupHeader.OwnerTableView.RenderColumns[i].UniqueName == "ColumnThree")
                {
                    groupHeader.Cells[i - 1].Text = "Three";
                }
                else if (groupHeader.OwnerTableView.RenderColumns[i].UniqueName == "ColumnFour")
                {
                    groupHeader.Cells[i - 1].Text = "Four";
                }
                else if (groupHeader.OwnerTableView.RenderColumns[i].UniqueName == "ColumnFive")
                {
                    groupHeader.Cells[i - 1].Text = "Five";
                }
                else if (groupHeader.OwnerTableView.RenderColumns[i].UniqueName == "ColumnSix")
                {
                    groupHeader.Cells[i - 1].Text = "Six";
                }
                else if (groupHeader.OwnerTableView.RenderColumns[i].UniqueName == "ColumnSeven")
                {
                    groupHeader.Cells[i - 1].Text = "Seven";
                }
                else if (groupHeader.OwnerTableView.RenderColumns[i].UniqueName == "ColumnEight")
                {
                    groupHeader.Cells[i - 1].Text = "Eight";
                }
                else if (groupHeader.OwnerTableView.RenderColumns[i].UniqueName == "ColumnNine")
                {
                    groupHeader.Cells[i - 1].Text = "Nine";
                }               
            }
        }
Angel Petrov
Telerik team
 answered on 28 Feb 2013
1 answer
46 views
inside radAccommodation_DetailTableDataBind
events get radcombobox id.using findcontrol and bind combobox
Princy
Top achievements
Rank 2
 answered on 28 Feb 2013
3 answers
142 views
I just went to create a new custom skin and noticed the builder still hasn't been updated.

Any idea when it'll be updated?
Bozhidar
Telerik team
 answered on 28 Feb 2013
3 answers
294 views
Hello.

I have dinamically created a treeList. I add a new header item and I want the first cell to be merged with the following cells. Even if I set colspan to the cell, after rendering in page, the cell will always have colspan 2.
// Initialize the first header
var headerItemGrayLine = new TreeListHeaderItem(RadTreeListLocations, TreeListItemType.HeaderItem, false);

// Adding cells
headerItemGrayLine.Cells.Add(
new TreeListTableHeaderCell { ColumnSpan = 13, Height = 50, BackColor = LocationColor, BorderWidth = 0});
for (int i = 1; i < 13; i++)
{
  headerItemGrayLine.Cells.Add(new TreeListTableHeaderCell { ColumnSpan = 0, Height = 50, BackColor = LocationColor, BorderWidth = 0, Visible = false });
}

What am I missing? I attach a picture to see better what is the problem.

Thank you,
Antonio Stoilkov
Telerik team
 answered on 28 Feb 2013
3 answers
332 views
Hi All,

I was struggling with adding items from client side. I got a RadTextbox and RadCombobox. On a radbutton client click, i want to get the textbox value and add it into the Radcombobox. This I was trying with JavaScript but didnt come up with the right code. Please help.

Antony.
Princy
Top achievements
Rank 2
 answered on 28 Feb 2013
1 answer
205 views
Hi folks,

Dont know whether its an absurd question, Is it possible to change the drop down icon of the RadCombobox. If yes, Can anyone help me to sort it out?

Thanks,
Henry
Shinu
Top achievements
Rank 2
 answered on 28 Feb 2013
1 answer
72 views
Hi,

I have the following requirement. There is a RadDropDownList containing three items and a RadButton on my submitDocs page. Based on the RadDropDownList selected item, I want to display the RadWindow contents on a RadButton click. Suppose the selected item is Item1, then on button click the Radwindow must display contents from www.samplesite.com/samplepage.aspx URL. Similarly for another item, display content from another URL. I prefer client side code to accomplish the above.

Thank You,
Saira.
Princy
Top achievements
Rank 2
 answered on 28 Feb 2013
3 answers
251 views
Hello,

There is  a Radcaptcha on my registration page. I want to use a custom RadTextbox where the user can enter the captcha characters apart from its native Textbox. How to implement this?

Thanks in Advance,
Berk.
Shinu
Top achievements
Rank 2
 answered on 28 Feb 2013
1 answer
283 views
I have the following radgrid markup. Toward the bottom I have an asp Panel that I cannot find using C# FindControl(). If anyone has any tips on how to do this, please let me know.

<telerik:RadGrid runat="server" ID="UnapprovedPOsGrid" AutoGenerateColumns="False"
                                Skin="Metro" DataSourceID="UnapprovedPOsDataSource" AllowAutomaticInserts="true"
                                OnItemCommand="UnapprovedPOsGrid_ItemCommand" OnItemDataBound="UnapprovedPOsGrid_ItemDataBound" OnEditCommand="UnapprovedPOsGrid_EditCommand"
                                AllowAutomaticDeletes="true" AllowAutomaticUpdates="true">
                                <MasterTableView EditMode="EditForms" CommandItemDisplay="Top" DataKeyNames="PO_ID"
                                    ExpandCollapseColumn-ButtonType="LinkButton" ShowHeadersWhenNoRecords="true"
                                    GroupsDefaultExpanded="false" GroupLoadMode="server" ShowGroupFooter="true" DataSourceID="UnapprovedPOsDataSource">
                                    <Columns>
                                        <telerik:GridEditCommandColumn ButtonType="LinkButton" EditText="View" UniqueName="ViewCommandColumn"></telerik:GridEditCommandColumn>
                                        <telerik:GridBoundColumn HeaderText="Purchase Order Number" DataField="PO_ID" />
                                        <telerik:GridBoundColumn HeaderText="Description of Item" DataField="POI_DescriptionOfItem" />
                                        <telerik:GridBoundColumn HeaderText="Employee" DataField="PO_EmployeeName" />
                                        <telerik:GridBoundColumn HeaderText="Vendor" DataField="PO_VendorName">
                                        </telerik:GridBoundColumn>
                                    </Columns>
                                    <EditFormSettings ColumnNumber="3" EditFormType="Template">
                                        <FormTemplate>
                                            <table>
                                                <tr>
                                                    <td>
                                                        <div>
                                                            <strong>Employee Name</strong>
                                                        </div>
                                                        <div>
                                                             <asp:Label runat="server" ID="EmployeeLabel" Text='<%# Bind("PO_EmployeeName") %>'>
                                                            </asp:Label>
                                                        </div>
                                                    </td>
                                                    <td>
                                                        <div>
                                                            <strong>Vendor Name</strong>
                                                        </div>
                                                        <div>
                                                             <asp:Label runat="server" ID="VendorNameLabel" Text='<%# Bind("PO_VendorName") %>'>
                                                            </asp:Label>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <div>
                                                            <strong>Vendor Phone</strong>
                                                        </div>
                                                        <div>
                                                             <asp:Label runat="server" ID="VendorPhoneLabel" Text='<%# Bind("PO_VendorPhone") %>'>
                                                            </asp:Label>
                                                        </div>
                                                    </td>
                                                    <td>
                                                        <div>
                                                            <strong>Division Director</strong>
                                                        </div>
                                                        <div>
                                                             <telerik:RadTextBox runat="server" ID="DivisionDirectorApprovalLabel" Text='<%# Bind("PO_DivisionDirectorApproval") %>'>
                                                            </telerik:RadTextBox>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <div>
                                                            <strong>Approved By Division Director</strong><br />
                                                            <br />
                                                        </div>
                                                    </td>
                                                    <td>
                                                        <div>
                                                            <asp:CheckBox runat="server" ID="DivisionDirectorApprovalCheckBox" Checked='<%# Bind("PO_DivisionDirectorApproved") %>'
                                                                TextAlign="Left" Enabled="true" /><br />
                                                            <br />
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <div>
                                                            <strong>Estimated Delivery Date</strong>
                                                        </div>
                                                        <div>
                                                             <asp:Label runat="server" ID="EstimatedDeliveryDateLabel" Text='<%# Bind("PO_EstimatedDeliveryDate") %>'></asp:Label>
                                                        </div>
                                                    </td>
                                                    <td>
                                                        <div>
                                                            <strong>Company Name Ordered In</strong>
                                                        </div>
                                                        <div>
                                                             <asp:Label runat="server" ID="CompanyNameOrderedInLabel" Text='<%# Bind("PO_CompanyNameOrderedIn") %>'
                                                                Enabled="false">                                           
                                                            </asp:Label>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <div>
                                                            <strong>Division</strong>
                                                        </div>
                                                        <div>
                                                             <asp:Label runat="server" ID="DivisionLabel" Enabled="false" Text='<%# Bind("PO_Division") %>'>                                           
                                                            </asp:Label>
                                                        </div>
                                                    </td>
                                                    <td>
                                                        <div>
                                                            <strong>Payment Method</strong>
                                                        </div>
                                                        <div>
                                                             <asp:Label runat="server" ID="PaymentMethodLabel" EmptyMessage="Select..."
                                                                Text='<%# Bind("PO_PaymentMethod") %>'>
                                                            </asp:Label>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <div>
                                                            <strong>To Be Ordered By</strong>
                                                        </div>
                                                        <div>
                                                             <asp:Label runat="server" ID="ToBeOrderedByLabel" Text='<%# Bind("PO_ToBeOrderedBy") %>'>
                                                            </asp:Label>
                                                        </div>
                                                    </td>
                                                </tr>
                                            </table>
                                            <telerik:RadGrid runat="server" ID="UnapprovedPOsItemsGrid" DataSourceID="UnapprovedPOsItemsDataSource"
                                                OnItemDataBound="UnapprovedPOsItemsGrid_ItemDataBound" AutoGenerateColumns="false">
                                                <MasterTableView CommandItemDisplay="Top" DataKeyNames="PO_ID" ShowHeadersWhenNoRecords="true"
                                                    GroupsDefaultExpanded="false" GroupLoadMode="server" ShowGroupFooter="true" DataSourceID="UnapprovedPOsItemsDataSource">
                                                    <CommandItemTemplate>
                                                        <asp:Label ID="ItemsBeingPurchasedLabel" runat="server" Width="170px" Text="Items Being Purchased"
                                                            Style="font-weight: bold; padding: 5px 0 5px 5px"></asp:Label>
                                                    </CommandItemTemplate>
                                                    <Columns>
                                                        <telerik:GridBoundColumn DataField="PO_ID" Visible="false">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="Description of Item" DataField="POI_DescriptionOfItem" />
                                                        <telerik:GridBoundColumn HeaderText="Reason For Purchase" DataField="POI_ReasonForPurchase" />
                                                        <telerik:GridBoundColumn HeaderText="Quantity" DataField="POI_Quantity" FooterAggregateFormatString="<b>Total Quantity: </b>{0}" />
                                                        <telerik:GridBoundColumn HeaderText="Unit Price" DataField="POI_UnitPrice" FooterAggregateFormatString="<b>Total Price: </b>{0}" />
                                                        <telerik:GridBoundColumn HeaderText="Amount" DataField="POI_Amount" FooterAggregateFormatString="<b>Total Amount: </b>{0}" />
                                                        <telerik:GridBoundColumn HeaderText="Price Quoted" DataField="POI_PriceQuoted" FilterControlWidth="80px" />
                                                        <telerik:GridBoundColumn HeaderText="Price Estimated" DataField="POI_PriceEstimated" />
                                                        <telerik:GridBoundColumn HeaderText="Additional Costs" DataField="POI_AdditionalCosts"
                                                            FilterControlWidth="80px" />
                                                        <telerik:GridBoundColumn HeaderText="Explanation of Additional Costs" Display="false"
                                                            DataField="POI_AdditionalCostsExplanation" />
                                                    </Columns>
                                                    <NestedViewSettings DataSourceID="UnapprovedPOsItemsDataSource">
                                                        <ParentTableRelation>
                                                            <telerik:GridRelationFields DetailKeyField="POI_Item_ID" MasterKeyField="POI_Item_ID" />
                                                        </ParentTableRelation>
                                                    </NestedViewSettings>
                                                    <NestedViewTemplate>
                                                        <div style="padding-left: 30px; padding-top: 20px; padding-bottom: 20px;">
                                                            <table>
                                                                <tr>
                                                                    <td>Description of Item
                                                                    </td>
                                                                    <td>
                                                                        <asp:Label runat="server" ID="ItemDescriptionTextBox" Text='<%# Bind("POI_DescriptionOfItem") %>'></asp:Label>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td>Reason For Purchase
                                                                    </td>
                                                                    <td>
                                                                        <asp:Label runat="server" ID="ReasonForPurchaseTextBox" Text='<%# Bind("POI_ReasonForPurchase") %>'>
                                                                        </asp:Label>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td>Quantity
                                                                    </td>
                                                                    <td>
                                                                        <asp:Label runat="server" ID="QuantityNumericTextBox" Text='<%# Bind("POI_Quantity") %>'>
                                                                        </asp:Label>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td>Unit Price
                                                                    </td>
                                                                    <td>
                                                                        <asp:Label runat="server" ID="UnitPriceNumericTextBox" Text='<%# Bind("POI_UnitPrice") %>'>
                                                                        </asp:Label>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td>Amount (Q x Price)
                                                                    </td>
                                                                    <td>
                                                                        <asp:Label runat="server" ID="AmountNumericTextBox" Text='<%# Bind("POI_Amount") %>'>
                                                                        </asp:Label>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td>Price Quoted
                                                                    </td>
                                                                    <td>
                                                                        <asp:Label runat="server" ID="PriceQuotedNumericTextBox" Text='<%# Bind("POI_PriceQuoted") %>'>
                                                                        </asp:Label>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td>Price Estimated
                                                                    </td>
                                                                    <td>
                                                                        <asp:Label runat="server" ID="PriceEstimatedNumericTextBox" Text='<%# Bind("POI_PriceEstimated") %>'>
                                                                        </asp:Label>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td>Additional Costs
                                                                    </td>
                                                                    <td>
                                                                        <asp:Label runat="server" ID="AdditionalCostsNumericTextBox" Text='<%# Bind("POI_AdditionalCosts") %>'>
                                                                        </asp:Label>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td>Explanation of Additional Costs
                                                                    </td>
                                                                    <td>
                                                                        <asp:Label runat="server" ID="ExplanationAdditionalCostsTextBox" Text='<%# Bind("POI_AdditionalCostsExplanation") %>'>
                                                                        </asp:Label>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                            <br />
                                                        </div>
                                                    </NestedViewTemplate>
                                                </MasterTableView>
                                            </telerik:RadGrid>
                                            <table>
                                                <tr>
                                                    <td>
                                                        <div>
                                                            <strong>Plus Sales Tax</strong>
                                                        </div>
                                                        <div>
                                                             <asp:Label runat="server" ID="PlusSalesTaxLabel" Text='<%# Bind("PO_PlusSalesTax") %>'>
                                                            </asp:Label>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <div>
                                                            <strong>Total Cost</strong>
                                                        </div>
                                                        <div>
                                                             <asp:Label runat="server" ID="TotalCostLabel" Text='<%# Bind("PO_TotalCost") %>'>
                                                            </asp:Label>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <div>
                                                            <strong>Supporting Documents</strong>
                                                        </div>
                                                        <asp:Panel runat="server" ID="supportingDocsPanel">
                                                              
                                                        </asp:Panel>
                                                    </td>
                                                </tr>
                                            </table>
                                            <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Save" : "Update" %>'
                                                runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' UseSubmitBehavior="true" />
                                             <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                                                UseSubmitBehavior="false" CommandName="Cancel" />
                                        </FormTemplate>
                                    </EditFormSettings>
                                </MasterTableView>
                            </telerik:RadGrid>
Shinu
Top achievements
Rank 2
 answered on 28 Feb 2013
1 answer
121 views
Hi,

In my web application, I am loading scripts from assemblies with short names and the RadScriptManager is generating the following error NullReferenceException: Object not set to an instance of an object. Later I replaced the RadScriptManager with the ASP ScriptManager and things are working fine. Do I have to add any additional settings/properties when using RadScriptManager or am I missing any reference that causes the RadScriptManager to generate the given exception?

Saira
Princy
Top achievements
Rank 2
 answered on 28 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?