Telerik Forums
UI for ASP.NET AJAX Forum
12 answers
417 views
Hi,

Yesterday I upgraded the telerik version to the latest 611 release and found that the RadGrid is not working fine as it was previously doing.
I have my RadGrid with some 10 columns and I have the ItemStyle-Width and the HeaderStyle-width set for each of the columns.
The grid renders fine for the first time when there is a postback performed the column settings are messed up for the headings.

I went in to check with the firebug tool and found that the colGroup settings are messed up when there is a postback.

 
<telerik:GridTemplateColumn HeaderText="One" SortExpression="One" DataField="One"
    UniqueName="One" ItemStyle-Width="10%" HeaderStyle-Width="10%">                   
    <ItemTemplate>
        <%# DataBinder.Eval(Container.DataItem, "One").ToString%> 
    </ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Two" SortExpression="Two"
    UniqueName="Two" DataField="Two" ItemStyle-Width="15%" HeaderStyle-Width="15%">
    <ItemTemplate>
        <%# DataBinder.Eval(Container.DataItem, "Two").ToString().Split(" ")(0)%> 
    </ItemTemplate>
</telerik:GridTemplateColumn>         
<telerik:GridTemplateColumn HeaderText="Three" SortExpression="Three" DataField="Three"
    UniqueName="Three" ItemStyle-Width="20%" HeaderStyle-Width="20%">                   
    <ItemTemplate>
        <%# DataBinder.Eval(Container.DataItem, "Three").ToString%> 
    </ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Four" SortExpression="Four" DataField="Four"
    UniqueName="Four" ItemStyle-Width="20%" HeaderStyle-Width="20%">                   
    <ItemTemplate>
    <%# DataBinder.Eval(Container.DataItem, "Four").ToString.Replace(Chr(13),"</br>")%> 
    </ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Five" SortExpression="Five"
    UniqueName="Five" DataField="Five" ItemStyle-Width="20%" HeaderStyle-Width="20%">
    <ItemTemplate>
        <%# DataBinder.Eval(Container.DataItem, "Five").ToString%> 
    </ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Six" SortExpression="Six"
    UniqueName="Six" DataField="Six" ItemStyle-Width="8%" HeaderStyle-Width="8%">
    <ItemTemplate>
        <%# DataBinder.Eval(Container.DataItem, "Six").ToString().Split(" ")(0)%>
    </ItemTemplate>
</telerik:GridTemplateColumn>

Column settings for the colGroup changes during a postback. I found an extra set of col width setting inserted after postback which has the width set in pixels. Where as the width settings for the tbody contents are fine. I have attached an image showing the width settings rendered before and after postback below.

Please do let me know how this issue can be fixed.

Thanks,
Karthik

Karthik
Top achievements
Rank 1
 answered on 29 Oct 2013
4 answers
143 views
I have a requiredfieldvalidator for a raddropdownlist in a radgrid and it will not fire in editmode or insert.  The other requried validators in the grid are firing, but this one doesn't want to work.  What is the problem?  Here is the code-

 <telerik:GridTemplateColumn HeaderStyle-Width="200px" HeaderText="Fund" UniqueName="fund_id_fk"
                            DataField="fund_id_fk">
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblFund" Width="200px" Text='<%# Eval("unit_ep_funds.fund_name") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadDropDownList runat="server" ID="FundIDDropDown" DataValueField="fund_id"
                                    SelectedValue='<%# Bind("fund_id_fk") %>' DataTextField="fund_name" DataSourceID="EntityDataFunds"
                                    AppendDataBoundItems="true">
                                    <Items>
                                        <telerik:DropDownListItem Text="Select a fund" Value="-1" />
                                    </Items>
                                </telerik:RadDropDownList>
                                <asp:RequiredFieldValidator InitialValue="-1" ID="RequiredFieldValidator11" ControlToValidate="FundIDDropDown"
                                    ErrorMessage="**Required" runat="server">
                                </asp:RequiredFieldValidator>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
Princy
Top achievements
Rank 2
 answered on 29 Oct 2013
7 answers
872 views
This related to my support request http://www.telerik.com/account/support-tickets/view-ticket.aspx?threadid=447674

I have a hierarchical grid. The hierarchy is as follows
Specimen-->Part-->Block-->Slide

The Part table has 2 children. Tracking records and Blocks. All the grid expansion is at client side. 
Sometimes there might not be any tracking records. 
I have 2 questions 
  1. How do I hide the headers and footers (from javascript) for the details table if there is no data. 
  2. If there are no records, I bind the grid to an empty string. This displays the message 'No child records to display.'. How can I set my custom message?


I have searched the forums for this without luck. 
Please help. 

Thanks in advance
   
Kostadin
Telerik team
 answered on 29 Oct 2013
3 answers
189 views

I am having trouble getting the Q3 2013 PivotGrid (most recent release) to display data from the Pivot Grid control.


My pivot grid definition (I have no code-behind related to it) is below, along with some code I have in the PageLoad function of the page.  The code from the PageLoad function works fine, but I can't seem to get anything to display in the PivotGrid.  According to the SQL 2012 docs, we don't need to use msmdpump.dll anymore for remote access.  Is that part of my problem? 



I have the Microsoft.AnalysisServices.AdomdClient (v11) referenced and in the bin folder of the web site.



Pivot Grid code:

<telerik:RadPivotGrid ID="RadPivotGrid1" runat="server">
        <PagerStyle ChangePageSizeButtonToolTip="Change Page Size" PageSizeControlType="RadComboBox"/>
         
        <OlapSettings ProviderType="Adomd">
            <AdomdConnectionSettings 
                Cube="UtilitySmart" 
                Database="UtilitySmart" 
                ConnectionString="Data Source=SERVERNAME; Catalog=UtilitySmart;">
            </AdomdConnectionSettings>
                
        </OlapSettings>
         
        <Fields>
            <telerik:PivotGridRowField DataField="[Dim Utility Smart Property].[Portfolio]" Caption="Portfolio" UniqueName="Portfolio"/>
            <telerik:PivotGridAggregateField DataField="[Measures].[AmtPaid]" Caption="Amount Paid" UniqueName="AmtPaid"/>
        </Fields>       
 
        <ConfigurationPanelSettings EnableOlapTreeViewLoadOnDemand="True" LayoutType="OneByFour"/>
    </telerik:RadPivotGrid>




PageLoad code:

var conn = new AdomdConnection("Data Source=SERVERNAME;Catalog=UtilitySmart;");
               conn.Open();
 
               var cmd = new AdomdCommand("SELECT [Dim Utility Smart Property].[Portfolio].Members ON ROWS, [Measures].[Amt Paid] ON COLUMNS FROM [UtilitySmart] ", conn);
 
               var resultObj = cmd.Execute();








Antonio Stoilkov
Telerik team
 answered on 29 Oct 2013
2 answers
131 views



I have a grid that is adding combo boxes to the autogenerated header rows and when 
the user clicks a button on the page I will need to determine what they selected in these combo boxes...

So I have been playing around with a foreach loop and trying to get a hock into the column's header and get the combo's.... Any suggestions?

protected void ValidateButton_Click(object sender, EventArgs e)
        {
  
// Foreach loop that will need to access the header controls and determine what a user selected in a dynamically injected //combobox...
//
}

Method that populates the Header row with combo boxes

protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridHeaderItem)
            {
                GridHeaderItem item = e.Item as GridHeaderItem;
                var columnName = "Column";
                var columnCount = 0;
                foreach (GridColumn col in RadGrid1.MasterTableView.AutoGeneratedColumns)
                {
                    RadComboBox radCombo = new RadComboBox();
                    radCombo.ClientIDMode = ClientIDMode.Static;
                    radCombo.ID = "Column" + columnCount;
                    radCombo.EmptyMessage = "Select Field";
 
                    //Need to get fields and etc,then loop and add
                    var receiveByTagsFields = GetReceiveByTagFields(Convert.ToInt32(PurchaseShipmentUid));
                    foreach (var field in receiveByTagsFields.ReceiveByTagImportFields.OrderBy(x => x.Label))
                    {
                        RadComboBoxItem CBitem = new RadComboBoxItem();
                        CBitem.ClientIDMode = ClientIDMode.AutoID;
                        CBitem.Text = field.Label;
                        CBitem.Value = field.Id.ToString();
                        radCombo.Items.Add(CBitem);
                    }
 
                    if (receiveByTagsFields.MetaFields.Count() != 0)
                    {
                        foreach (var field in receiveByTagsFields.MetaFields.OrderBy(x => x.Label))
                        {
                            RadComboBoxItem CBitem = new RadComboBoxItem();
                            CBitem.ClientIDMode = ClientIDMode.AutoID;
                            CBitem.Text = field.Label;
                            CBitem.Value = field.InventoryMetaUid.ToString();
                            radCombo.Items.Add(CBitem);
                        }
                    }
 
                    LinkButton link = new LinkButton();
                    link.ClientIDMode = ClientIDMode.AutoID;
                    link.Text = "Edit";
                    LiteralControl br = new LiteralControl("<br />");
                    if (col.ColumnType == "GridBoundColumn" || col.ColumnType == "GridNumericColumn")
                    {
                        item[col.UniqueName].Controls.Add(br);
                        item[col.UniqueName].Controls.Add(radCombo);
                    }
                    radCombo.Items.Add(new RadComboBoxItem("Do not import", "-1"));
                    columnCount++;
 
                }
            }
        }


Konstantin Dikov
Telerik team
 answered on 29 Oct 2013
1 answer
106 views
Hi,
I would a grid with many ImageButtons on the row that call many different function.
In this row I've yet the button of Select and Delete.

How can I do this ?

Thanks
Princy
Top achievements
Rank 2
 answered on 29 Oct 2013
2 answers
108 views
Hello friends,
I am working on a new project which is having about 15 different big modules. we are having requirement like each module should be having its own recognition factor by color. That means Module1 is having Red, Module2 is having Blue, Module3 is having Green and so on. This means when a user get inside the module all look and feel should resemble this color across controls. If user get inside Module1 (which should be using Red color), then all controls (RadGrid, RadCombo or whatever control that is used) should give look and feel of Red. This will give a recognition factor to user.
So, I am trying to figure this out in Telerik Controls. As, we also require to use some advanced functionalities like scheduler, advanced functionality in Grid. My question is; does telerik controls having  any type of mechanism to change the color of the controls based on the theme color of the module? I see that it has only some few set of read available skins. So, any option to above specified requirement?
Thanks for any help
Bozhidar
Telerik team
 answered on 29 Oct 2013
1 answer
128 views
RadFileExplorer:remove the delete and rename option for particular folder

i have one root node name :myfile
    subfolder:PrivateFolder


i want remove the delete and rename option for this private folder only how to achieve this

code :
private void RemoveUploadAndDelete(RadFileExplorer fileExplorer)
    {
        int i;// Global variable for that function


        RadToolBar toolBar = fileExplorer.ToolBar;
        // Remove commands from the ToolBar control;
        i = 0;
        while (i < toolBar.Items.Count)
        {
            if (toolBar.Items[i].Value == "Delete")
            {
                toolBar.Items.RemoveAt(i);
                continue;// Next item
            }

            else if (toolBar.Items[i].Value == "Rename")
            {
                toolBar.Items.RemoveAt(i);
                continue; // Next item
            }

            i++;// Next item
        }

        RadContextMenu treeViewContextMenu = fileExplorer.TreeView.ContextMenus[0];
        // Remove commands from the TreeView's ContextMenus control;

        i = 0;
        while (i < treeViewContextMenu.Items.Count)
        {
            if (treeViewContextMenu.Items[i].Value == "Delete")
            {
                treeViewContextMenu.Items.RemoveAt(i);
                continue;// Next item
            }

            else if (treeViewContextMenu.Items[i].Value == "Rename")
            {
                treeViewContextMenu.Items.RemoveAt(i);
                continue;// Next item
            }

            i++;// Next item
        }


        RadContextMenu gridContextMenu = fileExplorer.GridContextMenu;
        // Remove commands from the GridContextMenu control;

        i = 0;
        while (i < gridContextMenu.Items.Count)
        {
            if (gridContextMenu.Items[i].Value == "Delete")
            {
                gridContextMenu.Items.RemoveAt(i);
                continue;// Next item
            }

            else if (gridContextMenu.Items[i].Value == "Rename")
            {
                gridContextMenu.Items.RemoveAt(i);
                continue;// Next item
            }

            i++;// Next item
        }
    }


But it remove the option all the folder.i want remove the delete and rename option private folder only
 
Vessy
Telerik team
 answered on 29 Oct 2013
3 answers
135 views

this attached example (including radchart, multipage, pageviews) is decent but i found slow loading if the record amount is huge. i d like to modify it like programmatic binding with radGrid fires the DetailTableDataBind event. how can it do? can you show me the example?

Shinu
Top achievements
Rank 2
 answered on 29 Oct 2013
1 answer
796 views
Hi Guys,

I have a radbarcode with output type set to embeddedpng. Can someone help me to access the generated PNG image and save it in a memory stream?

Thanks for all your help,
Dan
Shinu
Top achievements
Rank 2
 answered on 29 Oct 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?