Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
148 views
I have a Hierarchical DataGrid that is created in a class then displayed dynamically to the form. I am unable to get the  ExpandCollapseCommandName to work on postback in the ItemCommand Event below.

private void ActiveBatchesRadGrid_ItemCommand(object source, GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.InitInsertCommandName)
    {
        GridTableView _gridTableView = (GridTableView)e.Item.OwnerTableView;
    }
    if (e.CommandName == RadGrid.ExportToExcelCommandName)
    {
        GridTableView _gridTableView = (GridTableView) e.Item.OwnerTableView;
        _gridTableView.GetColumn("PolicyEditRecord").Visible = false;
        _gridTableView.GetColumn("PolicyDeleteRecord").Visible = false;
        this.__activeBatchesRadGrid.MasterTableView.HierarchyDefaultExpanded = true;
    }
    if (e.CommandName == RadGrid.ExpandCollapseCommandName)
    {
        e.Item.Selected = !e.Item.Expanded;
    }
}


What I would like to do is to GetDataKeyValue() of the parent row when a parent row is expanded
Tim
Top achievements
Rank 2
 answered on 08 Sep 2011
5 answers
93 views
Hi,

I am trying to get the google-like-filtering on RadGrid control. I used the sample code from you website.

It seems like the visual studio is not finding where MyCustomFilteringColumnCS is coming from.. and, I am not sure what's the namespace for it either.

Could you let me know?

Thanks!
Dmitry
Top achievements
Rank 1
 answered on 08 Sep 2011
5 answers
239 views
Hi all,
             Can somebody let me know which control was used for telerik site search box

Thanks in Advance

Thomson
Brandon
Top achievements
Rank 1
 answered on 08 Sep 2011
1 answer
60 views
Hello,

I have searched and I cannot seem to find a solution to my issue, when creating a RadGrid programmatically (is that even a word?) everything seems to work fine except that something is wrong with the first page in the pager, I have a GridClientSelectColumn and when I try and use the select all box in the header I get this error:
Error: Unable to get value of the property '_selectAllRows': object is null or undefined

The strange thing is I can select things through the column itself and I can navigate the pager and select all from the other pages in the grid, when I do this something still messes up though. When I navigate away from the first page of the pager the grid is unable to load that first page again, nothing happens when you click on the first page.

If I build the grid on the front end everything seems to work fine.

The code is:

private RadGrid DefineGridStructure()
{
 RadGrid grid = new RadGrid();
 grid.ID = "OptOutGrid";

 grid.Width = Unit.Percentage(100);
 //grid.Height = Unit.Pixel(400);
 grid.CssClass = "LeftFloat Top15Margin RadGridAutoSize";
 grid.PageSize = 25;
 grid.EnableAjaxSkinRendering = true;
 grid.AllowPaging = true;
 grid.AutoGenerateColumns = false;
 grid.AllowMultiRowSelection = true;

 grid.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric;

 grid.ClientSettings.Selecting.AllowRowSelect = true;
 grid.ClientSettings.Selecting.UseClientSelectColumnOnly = true;
 grid.ClientSettings.Scrolling.AllowScroll = true;
 grid.ClientSettings.Scrolling.UseStaticHeaders = true;
 grid.ClientSettings.Scrolling.SaveScrollPosition = true;

 //grid.MasterTableView.DataKeyNames = new string[] { "PanelistID" };
 grid.MasterTableView.TableLayout = GridTableLayout.Fixed;

 GridBoundColumn col;

 col = new GridBoundColumn();
 col.DataField = "PanelistID";
 col.HeaderText = (string)GetLocalResourceObject("grid_PanelistID");
 col.UniqueName = "PanelistID";
 grid.MasterTableView.Columns.Add(col);

 col = new GridBoundColumn();
 col.DataField = "FirstName";
 col.HeaderText = (string)GetLocalResourceObject("grid_PanelistFirstName");
 col.UniqueName = "FirstName";
 grid.MasterTableView.Columns.Add(col);

 col = new GridBoundColumn();
 col.DataField = "LastName";
 col.HeaderText = (string)GetLocalResourceObject("grid_PanelistLastName");
 col.UniqueName = "LastName";
 grid.MasterTableView.Columns.Add(col);

 col = new GridBoundColumn();
 col.DataField = "Email";
 col.HeaderText = (string)GetLocalResourceObject("grid_PanelistEmail");
 col.UniqueName = "Email";
 grid.MasterTableView.Columns.Add(col);

 GridCheckBoxColumn chk;
 chk = new GridCheckBoxColumn();
 chk.DataField = "IsOptIn";
 chk.HeaderText = (string)GetLocalResourceObject("grid_PanelistOptIn");
 chk.ReadOnly = true;
 grid.MasterTableView.Columns.Add(chk);

 GridClientSelectColumn select = new GridClientSelectColumn();
 grid.MasterTableView.Columns.Add(select);

 return grid;
}

protected void PopulatePanelistGrid(List<int> ids)
{
 RadGrid grid = DefineGridStructure();
 grid.DataSource = GetPanelistData(ids);
 grid.DataBind();
 pnl_gridPanel.Controls.Add(grid);
}

Oh, the method PopulatePanelistGrid is called on Page_Load.

Thank you,
James
James
Top achievements
Rank 1
 answered on 07 Sep 2011
0 answers
156 views
UPDATE: D'Oh - seems to always be the simplest things that get overlooked. Need to have the  OnItemDataBound="RadGrid4_ItemDataBound" in the RadGrid definition. Now to get the formatting right...

Hi. I'm trying to apply some conditional formatting to a row in a RadGrid. I'm trying to get the values in a row formatted one way or another based on a column in each row. For the RadGrid itself in the .aspx I have in part:

<telerik:RadGrid ID="RadGrid4" runat="server" DataSourceID="SqlDataSource4"
                       GridLines="None" AllowSorting="True" AllowPaging="True">
        <ClientSettings>
          <Selecting AllowRowSelect="True" />
        </ClientSettings>
        <MasterTableView AutoGenerateColumns="False" DataSourceID="SqlDataSource4">
          <RowIndicatorColumn>
            <HeaderStyle Width="20px" />
          </RowIndicatorColumn>
          <ExpandCollapseColumn>
            <HeaderStyle Width="20px" />
          </ExpandCollapseColumn>
          <Columns>
            <telerik:GridBoundColumn DataField="MetricName" HeaderText="" ReadOnly="True"
                                     UniqueName="MetricName" HeaderTooltip="Metric Name">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="MetricValue" DataType="System.Decimal"
                                     HeaderText="Sales" ReadOnly="True" DataFormatString="{0:$###,###.##}"
                                     UniqueName="MetricValue" HeaderTooltip="Metric Value">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="MetricComp" DataType="System.Decimal" DataFormatString="{0:#.#%;(#.#%);''}"
                                     HeaderText="Comp %" ReadOnly="True" HeaderTooltip="MetricComp"
                                     UniqueName="MetricComp">
            </telerik:GridBoundColumn>
 
          </Columns>
        </MasterTableView>
      </telerik:RadGrid>

In the code behind .cs page I have:

protected void RadGrid4_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {    
        if (e.Item is GridDataItem)
        {
            GridDataItem dataItem = e.Item as GridDataItem;
            if (dataItem["MetricName"].Text == "Average Trans")
                dataItem.CssClass = "AverageTransRowClass";
        }
    }

From testing, it appears the ItemDataBound is never getting fired. Any ideas on what I can do to debug this? Thanks!
Susan
Top achievements
Rank 1
 asked on 07 Sep 2011
0 answers
61 views
Hi,

I am using RadTabStrip and RadMultiPage and adding a tab on runtime with a user control in it. I want to refresh the data in the user control on postback. Can anybody tell me how to do it?
Amit
Top achievements
Rank 1
 asked on 07 Sep 2011
2 answers
120 views
Hi there,

I am struggling with this problem for a few days now and can not get it to work.
In my solution, I have added a RadChart with a SqlDataSource like this:

<div>
  
        <telerik:RadChart ID="RadChart1" runat="server" DataSourceID="SqlDataSource1" 
            Height="400px" Skin="Vista" Width="800px">
        </telerik:RadChart>
          
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:EUD_SD_TodoListConnectionString %>" 
            SelectCommand="select s.Description [Status], DateName( month , DateAdd( month , Month(i.StartC) , 0 ) - 1 ) as [Month], count(*) as [Value] from Items i INNER JOIN Status s ON s.ID = i.StatusID where Year(i.StartC) = 2011 group by s.Description, Month(i.StartC) order by Month(i.StartC) desc">
        </asp:SqlDataSource>
       
    </div>

Code Behind to group the chart:

RadChart1.DataGroupColumn = "Status";
RadChart1.PlotArea.XAxis.DataLabelsColumn = "Month";
RadChart1.Legend.Appearance.GroupNameFormat = "#NAME:#VALUE";

I am trying to bind a crosstable to the RadChart control but I cannot manage to get it working, you can view the results of my query on the attached file in this post (Untitled.png).

The thing i am trying to do is to get the Year on the X-axis and the corresponsing status grouped by Year for the number of items existing (Value). AS you can see the Statuses are not mapped to the correct Year?

Can somebody help me with this matter?

If i configure it thrue the Chart Wizard it creates statis series items in the code, and the series have to be dynamic because the year/statuses can change in the dba...

Thanks in advance!
Nicolas
Nicolas
Top achievements
Rank 1
 answered on 07 Sep 2011
4 answers
131 views
I've run into a number of issues with a RadGrid control (containing a nested grid) which is used in a Visual Web Part for SharePoint 2010.  We are using the 2011.2.712.35 of the ASP.Net AJAX controls.

1) When a user clicks to either add a new grid item, or edit an existing one; the page posts-back and wipes out the left-hand navigation on the page. (see attached image)

2) When editing or inserting items; any button triggering a grid command (performinsert, update, cancel, refresh) does not refresh the grid and the user must browse away from the page and then back again.  It does appear that data is correctly updated or saved; but the form does not close or and the grid does not refresh.  Not sure if this may be related to the first item or not...

The code files are quite long; can they be attached rather than copy / pasted?

3) I also have a RadUploadAsync control in the the EditForm of the grid which does not appear to upload images properly. I'm sure this an RadUploadAsync + SharePoint + web.config issue; so I'd like to get the first two items sorted out first.


JR
Top achievements
Rank 1
 answered on 07 Sep 2011
3 answers
53 views
I'm trying to set the width programatically. I'm running into an issue of the graph area not stretching as far as I'd like. I'm setting the width by saying radchart1.width = myWidth. I tried setting the plot area dimensions like so radchart1.PlotArea.Appearance.Dimensions.Width = 500 but no matter what I change that number to, it doesn't resize at all. See my image for the issue I'm talking about.
Web Services
Top achievements
Rank 2
 answered on 07 Sep 2011
4 answers
70 views
My developers are encountering display issues in IE9.

There is a formview contained inside a multipage control. The edit mode of the formview uses a number of RadEditor controls; when the page is loaded, the controls don't display the toolbar correctly, and the control is rendered much wider than it should be. Also, the second and subsequent editors don't show the toolbar at all, and seem to overlap each other.

It works fine in Firefox, Chrome and Safari. We've looked at the css and can't see any issue, I've attached screen shots showing how it looks in Firefox (which is correct) and how it looks in IE.

Any ideas?
Derek
Top achievements
Rank 1
 answered on 07 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?