Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
310 views
Is it possible to have an image upload control in the insert / update templates? I have a grid i am using to edit / insert sections of a site that includes images and text.

Thanks.
Antonio Stoilkov
Telerik team
 answered on 10 Apr 2012
1 answer
685 views
I want to change the text displayed on a rad grid based on the current text it had
here is the code-behind in C#
EXAMPLE A
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem dataItem = (GridDataItem)e.Item;
 
                //Edits the text value of the column "Flow"
                if (dataItem["Flow"].Text == "1")
                {
                    dataItem["Flow"].Text = "Outcome";
                }
                if (dataItem["Flow"].Text == "2")
                {
                    dataItem["Flow"].Text = "Income";
                }
            }
        }

An awkward workaround I found is to use a hidden column replica like this
EXAMPLE B
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem dataItem = (GridDataItem)e.Item;
 
                //Edits the text value of the column "Flow"
                if (dataItem["FlowReplica"].Text == "1")
                {
                    dataItem["Flow"].Text = "Outcome";
                }
                if (dataItem["FlowReplica"].Text == "2")
                {
                    dataItem["Flow"].Text = "Income";
                }
            }
        }

This works nice, but not so nice when you are working with over 10 columns
that would make 10 more hidden replicas
Is there another way to make it work as I desired in the EXAMPLE A
thanks in advance
Princy
Top achievements
Rank 2
 answered on 10 Apr 2012
1 answer
50 views
I have clicked edit button of an item(Radgrid).

Now the particular row is in edit mode.

When i click the submit button.It should prompt me to save the edited row.

How can i achieve it.
Princy
Top achievements
Rank 2
 answered on 10 Apr 2012
3 answers
117 views
Hi, I need to personalizate the view for each element to show on the grid.

how can i make it?

I can insert code in the ItemTemplate ?
I need to do something like this:

if (eval(something).ToString() != "")
{
    <span style="font-weight: bold;">Something:</span><%# Eval("something") + "%>
}

I need it, because every row could have some empty column on it and I should not show the information about that column.

Shinu
Top achievements
Rank 2
 answered on 10 Apr 2012
2 answers
119 views
how do I create css in the site.css so it apply to all the editform in the web pages that contain radgrid control?

thanks
Henry
Top achievements
Rank 1
 answered on 10 Apr 2012
4 answers
218 views
Hello,

I have 3 grids nested inside a main grid using the NestedViewTemplate.  Everything works fine for binding and displaying the data.

The problem is I want to use a CommandItemTemplate in the nested grid to popup another window for inserting new parts.  I can make the
window pop-up, I just can not get the primary key from the top level grid to go with it.

I have tried all kinds of stuff, but I was hoping to do something like the snippet below to include the PlanID as an argument
to my javascript function:

<CommandItemTemplate> 
     <asp:Label ID="lblAddNewPart" Text="Add" runat="server"/>  
                      <href="#" onclick="return ShowAddPartForm('<%# Bind( "PlanID" ) %>');">Add New </a> 
</CommandItemTemplate> 


I am open to C# code behind to set the onclick attributes or javascript to dig around if necessary to get the PlanID from
the parent grid or the nested grid, it exists in both.

I have inserted sample markup below if that helps.

Thanks!

Tom

(Sorry for the blue, I should have typed before using the format code block?)




<
telerik:RadGrid ID="gridJobPlans" runat="server" DataSourceID="objJobPlans"   
    GridLines="None" AllowFilteringByColumn="True" AllowSorting="True"   
            AutoGenerateColumns="False"   
        onupdatecommand="gridJobPlans_UpdateCommand"   
         > 
              
<MasterTableView DataKeyNames="ID"   
        DataSourceID="obj1" CommandItemDisplay="TopAndBottom">  
          
 
     
 
    <NestedViewTemplate> 
    <asp:Label ID="PlanID" runat="server" Text='<%# Eval("ID") %>' /> 
        <telerik:RadTabStrip ID="RadTabStrip1" runat="server" SelectedIndex="1"   
            MultiPageID="MultiPageSelectedJobPlan">  
            <Tabs> 
                <telerik:RadTab runat="server" Text="Documents"   
                    PageViewID="SelectedJobPlanDocs">  
                </telerik:RadTab> 
            </Tabs> 
        </telerik:RadTabStrip> 
        <telerik:RadMultiPage ID="MultiPageSelectedJobPlan" Runat="server"   
            Width="703px" SelectedIndex="2">  
            <telerik:RadPageView ID="Parts" runat="server">  
                <telerik:RadGrid ID="Grid" runat="server"   
                    AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True"   
                    AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True"   
                    DataSourceID="objSelected2" GridLines="None" AllowAutomaticDeletes="true">  
                    <MasterTableView AutoGenerateColumns="False" DataKeyNames="ID, PlanID" 
                        CommandItemDisplay="TopAndBottom">  
                        <Columns> 
                            <telerik:GridBoundColumn DataField="ID" DataType="System.Int64" HeaderText="ID"   
                                ReadOnly="True" SortExpression="ID" UniqueName="ID" Display="false">  
                            </telerik:GridBoundColumn> 
                              
                            <telerik:GridBoundColumn DataField="PlanID" DataType="System.Int64"   
                                HeaderText="PlanID" SortExpression="PlanID" UniqueName="PlanID" Display="true">  
                            </telerik:GridBoundColumn> 
                              
                        </Columns> 
                          
                       <CommandItemTemplate> 
                    <asp:Label ID="lblAddNewPart" Text="Add" runat="server"/>  
                      <href="#" onclick="return ShowAddPartForm('<%# Bind( "PlanID" ) %>');">Add New </a> 
                    </CommandItemTemplate>    
                          
                    </MasterTableView> 
                </telerik:RadGrid> 
            </telerik:RadPageView> 
              
        </telerik:RadMultiPage> 
    </NestedViewTemplate> 
 
     
 
</MasterTableView> 
      
</telerik:RadGrid> 
 
eamon
Top achievements
Rank 1
 answered on 09 Apr 2012
3 answers
217 views
Hello all,

I've implemented an export all pages to Excel in my grid. My grid uses custom paging, template columns and is dynamically created on the server side.
I have a customer that tried to export all pages (80000 rows, not very big of a number) to Excel and his web server went to 100% CPU with over 1GB of RAM consumed for over 10 minutes. Then the CPU returned to normal but the memory stayed there for additional 20 minutes.Below please find the code snippet:
RadGrid GridReport = (RadGrid)GridPlaceHolder.FindControl("GridReport");
 
        if (GridReport.MasterTableView.Columns.FindByUniqueNameSafe("ObjectName") != null)
        {
            GridReport.MasterTableView.Columns.FindByUniqueName("ObjectName").Visible = false;
            GridReport.MasterTableView.Columns.FindByUniqueName("ObjectNameText").Visible = true;
        }
 
        //GridReport.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML;
        GridReport.ExportSettings.Excel.Format = GridExcelExportFormat.Html;
        GridReport.ExportSettings.IgnorePaging = true;
        GridReport.ExportSettings.OpenInNewWindow = true;
        GridReport.ExportSettings.ExportOnlyData = true;
 
         
        if (cbExportAllPages.Checked == true)
            GridReport.PageSize = GridReport.MasterTableView.VirtualItemCount;
 
        GridReport.DataSource = reportResult(Session["sqlStr"].ToString());
        GridReport.Rebind();
 
        GridReport.MasterTableView.ExportToExcel();

I searched all over the forums, saw that other people had this issue, but couldn't find a vaible solution.
Tried IgnorePaging flase and true. Tried Format of HTML and ExcelML. nothing.
The ExportToExcel() function simply kills the website.

Anyone has an idea?

Thanks,
T.
Antonio Stoilkov
Telerik team
 answered on 09 Apr 2012
6 answers
140 views
Hello,

   I am using the RadAsyncUpload in a grid. Everything works fine on the localhost. After i publish the app on server, when i try to  edit a row, it doesn't work. Same is the case with Add a record .It doesn't let me add a new row to the grid. However, i notice that the delete command is working. I followed the demo in the link below.

 http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandradasyncupload/defaultcs.aspx?product=grid

Am i missing something here?
Appreciate the help
Thanks

Jagat
Top achievements
Rank 1
 answered on 09 Apr 2012
3 answers
153 views
I am working on web page which has a radgrid similar to the one displayed on this page.  http://demos.telerik.com/aspnet-ajax/grid/examples/programming/detailtabledatabind/defaultcs.aspx

The grid datasources are business objects which are popupated from DB2 tables.

The business requirements are: 

In the Order Detail grid, the Quantity is displayed in a text box.  I am using

RadNumericTextBox in a GridTemplateColumn.

The user can update the Quantity on the Order Detail grid and click the Save button to save the Order Detail.  This Save button is displayed in the Order Detail NestedViewTemplate.

The user can update one Order Detail at a time which mean when he/she expands other Order node, the web page needs to display an alert or confirm to prompt the user to save the updated Quantity before expanding the next Order detail.

 

 

 


When the user expands the Customer Order node, I am retrieving and setting the datasource of the Order Detail grid in the RadGrid1_ItemCommand event handler.  Could someone please tell me is there a way to display an alert or confirm to prompt the user to save the updated Quantity before expanding the next Order detail?  Why does OnHierarchyExpanding client event requires HierarchyLoadMode="Client"?  I am not allowed to use databinding on the client side.

Thanks for your help!

 

Pavlina
Telerik team
 answered on 09 Apr 2012
3 answers
108 views
hi have a radtextbox with emptymessage it was working good until we update to the new version of telerik, now it looks weird, teh emptymessage exceeds the textbox and in the design it looks as i having to textbox how can i fix this???
Galin
Telerik team
 answered on 09 Apr 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?