Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
143 views
Dear All,

I'm using

protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            RadGrid1.DataSource = GridDataSource;            
        }


to bind the grid, and in the front page (aspx) it's like

<telerik:RadGrid ID="RadGrid1" runat="server" MasterTableView-CommandItemDisplay="Top" OnNeedDataSource="RadGrid1_NeedDataSource" AllowPaging="True" AllowSorting="True" AllowFilteringByColumn="True" ShowGroupPanel="True" PageSize="20" Skin="WebBlue">
                        <ClientSettings AllowDragToGroup="True">
                            <Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling>
                        </ClientSettings>
                    </telerik:RadGrid>

I'd just like to ask how can I set the dataformatstring = "{0:d}" to certain columns for example?

Thanks
Tim
Top achievements
Rank 1
 answered on 16 Jul 2014
6 answers
176 views
Hello,

I am currently working on a project with a RadGrid.
The Grid has 2 levels: master and detail.

The Settings of the Grid and the DetailView are in the
Page_Load: 
RadGrid1.MasterTableView.AllowPaging = False
Dim tableViewOrders = New GridTableView(RadGrid1)
RadGrid1.MasterTableView.DetailTables.Add(tableViewOrders)
tableViewOrders.AllowPaging = True
tableViewOrders.PageSize = 10
RadGrid1.AllowSorting = True
RadGrid1.ClientSettings.Scrolling.UseStaticHeaders = True
RadGrid1.AllowFilteringByColumn = True
RadGrid1.MasterTableView.HeaderStyle.Width = Unit.Pixel(200)
RadGrid1.ClientSettings.EnableRowHoverStyle = True
RadGrid1.MasterTableView.AllowNaturalSort = False
tableViewOrders.AllowNaturalSort = False

This is the code for the event DetailTableDataBind:
Private Sub RadGrid1_DetailTableDataBind(sender As Object, e As GridDetailTableDataBindEventArgs) Handles RadGrid1.DetailTableDataBind
        'If rep.Ready_Data.Tables.Count > 1 Then
        Dim dataItem As GridDataItem = CType(e.DetailTableView.ParentItem, GridDataItem)
        Dim cellID As TableCell = dataItem("_key_id")
  
        Dim ConnectID As String = cellID.Text
        rep.Ready_Data.Tables(1).DefaultView.RowFilter = ""
        rep.Ready_Data.Tables(1).DefaultView.RowFilter = "_parent_key_id = " & ConnectID
        e.DetailTableView.DataSource = rep.Ready_Data.Tables(1).DefaultView
  
    End Sub

How can I hide some of the columns in detailView?

If I add the following lines into Page_Load:
tableViewOrders.GetColumn("_parent_key_id").Display = False
tableViewOrders.GetColumn("key_id").Display = False

It gives me the following error: 
Cannot find a column with UniqueName '_parent_key_id'
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
 
Exception Details: Telerik.Web.UI.GridException: Cannot find a column with UniqueName '_parent_key_id'
 
Source Error:
Line 208:        tableViewOrders.GetColumn("_parent_key_id").Display = False
Line 209:        tableViewOrders.GetColumn("key_id").Display = False

(It seems the RadGrid doesn’t yet recognize these columns)
 
How can I hide these columns?

 
Thanks,

Daniel.
Daniel
Top achievements
Rank 1
 answered on 16 Jul 2014
1 answer
177 views
Do you have any performance numbers for the time to upload files comparing your asyncupload to the regular asp:upload control? In this case the files will be .mov or .mp4 movies.  Any numbers, either actual upload onto the server or perceptual, would be greatly appreciated.  Thanks for your help, this is important to us.
Thanks!
Genady Sergeev
Telerik team
 answered on 16 Jul 2014
2 answers
157 views
Hi,

I would like to use multiple paths but from a sql reading loop.
How can I do that?

Of course this isn't working:

while (reader.Read())
{
folderName= (string)reader["folderName"];
viewPaths = new string[] { "~/Documents/" + folderName};
}

Thanks!
Attila
Top achievements
Rank 1
 answered on 16 Jul 2014
1 answer
188 views
When I click on an item I would like to fill my TextBox with numbers from a column from Grid2 after Grid1 is clicked. Right now if I click on an item in Grid1 it will then run a procedure that will fill Grid2 with data. Here is an example of the current functionality with picture attached. I click an item from Grid1 and it has 3 results, my textbox will still display as an empty textbox. Then I click another item in Grid1 and now my textbox will display the 3 results from the previously clicked item. How can I display the correct numbers in my textbox after an item is selected in Grid1. 

Here are some snippets of what I currently have:
protected void Grid_Product_List_Details_PreRender(object sender, EventArgs e)
    {
        RadGrid grid = (RadGrid)sender;
 
        if (grid.Items.Count > 0)
            {
                RadTextBox1.Text = "";
            }
 
        for (int i = 0; i < grid.Items.Count; i++)
            {
 
                RadTextBox1.Text += grid.Items[i].GetDataKeyValue("number").ToString() + "\n";
            }
        RadTextBox1.DataBind();
 
    }


or I can comment out the above and use this to achieve the same results which are not correct:
protected void Grid_Product_List_Header_SelectedIndexChanged(object sender, EventArgs e)
    {
        RadTextBox1.Text = "";
        for (int i = 0; i < Grid_Product_List_Details.Items.Count; i++)
        {
 
            RadTextBox1.Text += Grid_Product_List_Details.Items[i].GetDataKeyValue("number").ToString() + "\n";
        }    
    }
Princy
Top achievements
Rank 2
 answered on 16 Jul 2014
2 answers
144 views


Hi,

I have grid control that that has master / detail
setup.  I’m trying to get this to export
to excel (html) but I’m having trouble figuring out how to apply 1 type of
formatting to master data and another type of formatting to child data


So for example this code applies formatting to all rows


        
protected void RadGrid1_ExportCellFormatting(object sender, ExportCellFormattingEventArgs e)
{
    GridDataItem item = e.Cell.Parent as GridDataItem;
 
    if (item.ItemType == GridItemType.AlternatingItem)
        item.Style["background-color"] = "#359AFF";
    else
        item.Style["background-color"] = "#2D62FF";
 
}


 Any ideas how I accomplish separate formatting please?

Andy
Top achievements
Rank 1
 answered on 16 Jul 2014
1 answer
220 views
We recently upgraded to the 2014 Q1 release(2014.1.403.35). Since the update some of our grids footers paging next/previous buttons stopped working.

The grid loads the first page fine, then when you click the next button it load the second page, if you then click it again it stays at page two. Using the next button it never goes beyond the second page. The last page button works but if you then click the back button again it wont go to the previous page but all the way back to the first page again.

This only happens when I have AllowPaging="true" The pages with AllowCustomPaging="true" works fine.

I created a PageIndexChanged event for the grid and found the following:

In this example the page has 1210 items, 25 items per page so there is 49 pages.

If I click next page, the NextPageIndex is 1 (the grid then navigates to page 2)
When I click next page again, the NextPageIndex stays 1 (the grid stays on page 2)
If I click last page the NextPageIndex is 48. (it then navigates to page 49)
If you click page back or first page the event does not fire, but it navigates back to the first page.

This leads me to believe that the PageIndex is not being remembered somehow.

Do you have any idea what causes this and how to fix it?

Angel Petrov
Telerik team
 answered on 16 Jul 2014
2 answers
291 views
Hi,I’m having an issue regarding exporting a grid control to Excel. (Via HTML) I have a grid which contains other hierarchal grids.  For example at the moment I can export and it looks like this:



The problem is col10 & col11, they follow the column widths of Col1 & Col2 – the end result being that the data is bunched up

What I’d like to get to is this:



To get this currently involves merging the each complete row in excel, unfortunately this is unrealistic in a live environment.
Is there anything I can do to resolve this?

TIA.
Andy.
Andy
Top achievements
Rank 1
 answered on 16 Jul 2014
4 answers
232 views
Hello,

I am currently working on a project with a RadGrid.

I need only two types of sorting - Ascending and Descending (I
want to turn off “NoSort” option).

I looked into your documentation and saw that setting:
 [http://www.telerik.com/help/aspnet-ajax/grid-controlling-sorting-modes.html]

VB.NET:
RadGrid1.MasterTableView.AllowNaturalSort = False

But unfortunately it does not work for me.

Please see the following video:

http://youtu.be/2oZ-y7J1P2c 


It gives me all 3 options (Ascending, Descending, NoSort).

Thanks for your help,

Daniel.
Daniel
Top achievements
Rank 1
 answered on 16 Jul 2014
1 answer
125 views
Hi,
  i need a help.I want a floating search box,like that,when i will click on a search icon,then a search box will appear.otherwise,the search box will be hidden.
Magdalena
Telerik team
 answered on 16 Jul 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?