Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
75 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
178 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
69 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
140 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
162 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
100 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
92 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
7 answers
403 views
I am working on a process where a user uploads multiple files for processing. When the file has been uploaded it's name is added to a listbox. The user can then delete any files in the listbox that they didn't want processed. When the processing of the files start I am adding the processed file to another listbox and removing it from the first. This all works well except of course you don't see the move from one list to another until the entire server side event is finished.

I need to show those moves while the processing is going on. Is there a way to call a JavaScript routine to emulate this transfer until the server side processing is complete? My process flow is like this:

1) get filename from ListBox1.Item[0]
2) process file.
3) add filename to ListBox2
4) remove ListBox1.Item[0]
5) repeat until list empty.

Like I said, it works fine and displays after the server side processing completes. How can I show the change during processing?

And yes I looked at the client side examples.

David
Top achievements
Rank 1
 answered on 07 Sep 2011
1 answer
133 views
Hello,

I have a combobox which I populate with the Items object.
Each Item as an Image associate. I see the Image when I click on the combobox to select one element.
But, when I have selected the element, the image isn't display. 

How can I display the image when one item is selected?

Thank you for your help.


Donatien
Cat Cheshire
Top achievements
Rank 1
 answered on 07 Sep 2011
4 answers
88 views
We use Visual Style Builder to create a custom skin.  The tool seems to produce an outdated skin for an older Telerik ASP.Net release.  As an example, it appears to not specify theming for the RadButton at all.  There are also some other display anomalies that I am assuming are related to this skin versioning.

What is the status of the Visual Style Builder?  Does it indeed produce an outdated skin?  If so, is a new release immanent?  If not, what is the recommended route?  Should we not use the Visual Style Builder?  Is there a converter?  Should we use one of the supplied 12 skins?  Is it advisable for us to modify these skins by hand (i.e. without the Visual Style Builder)?

Thanks,
Mark
Ryan Regalado
Top achievements
Rank 1
 answered on 07 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?