Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
113 views
There's another thread with this topic but nobody answered.

I'm creating my contexmenu item at run time but I don't know why the event Item_click does not fire. When I add items at desing time, contextmenu works fine. The problem is when  I build my menu from DataBase. When I create my contexmenu item at run time, and clic an item of it, the page postbacks but never fire the item_Click events. 

My code

private void CreaMenuContextual(string sTipoCompromiso) 
    { 
        StringBuilder sSql = new StringBuilder(); 
        SqlCommand cmd = new SqlCommand(); 
        ClsData ObjData = new ClsData(ConfigurationManager.ConnectionStrings["MyCnnStr"].ConnectionString); 
 
 
        MenuCompromisos.DataTextField = "text_field"; 
        MenuCompromisos.DataValueField = "value_field"; 
 
        sSql.Append("   SELECT text_field, value_field"); 
        sSql.Append(" FROM TABLE"); 
         
        cmd.CommandText = sSql.ToString(); 
 
        MenuCompromisos.DataSource = ObjData.GetDataTable(cmd); 
        MenuCompromisos.DataBind(); 
 
    } 

Gilberto Anino
Top achievements
Rank 1
 answered on 11 Jun 2010
1 answer
51 views
Look at this code:
<
telerik:RadCalendar ID="RadCalendar1" runat="server" Width="280px"
    NavigationNextText="Next>" NavigationPrevText="<Prev" />
<Prev does not show. I guess "<" is a special char. Could some body show me how to make this work?

Thanks!

Joseph
 
Daniel
Telerik team
 answered on 11 Jun 2010
15 answers
1.0K+ views
Hi all,

I'm having problems exporting my radGrid to Excel.
I want to format my excel file by using the GridExportExcelMLRowCreated and GridExportExcelMLStyleCreated events.
Therefore I'm following the instructions of the demo on the telerik site:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/GeneralFeatures/Exporting/DefaultCS.aspx

The first thing I don't understand is that the sample code sets the exportonlydata = true;
But when you read the description, it says that you need to set the exportonlydate = false when you want to use Excel.Format.

But if I do the following, I get an error: Object not set to an instance of an object. NullReferenceException. This is not an error in de code, but this error appears when it wants to load the excel file --> after calling the ExportToExcel() Method.

rgd.ExportSettings.Excel.Format =

GridExcelExportFormat.ExcelML;
rgd.ExportSettings.ExportOnlyData =
true;
rgd.ExportSettings.OpenInNewWindow = true;
rgd.MasterTableView.ExportToExcel();

When I set the ExportOnlyData = false, my excel file opens, but nothing appears on the worksheet. If I set OpenInNewWindow = false --> my .aspx page hangs. Nothing happens.

The second issue I have is that I've set the GridExportExcelMLRowCreated and GridExportExcelMLStyleCreated events on my radGrid, but this code is not executed. I've placed a breakpoint, but nothing happens with these events.


Can someone please help me further? A simple export succeeds or when I place the GridExcelExportFormat.HTML  as Excel.Format, everything works fine, but I'm not able to place any style on my excel export like in the example of telerik.

Thanks in advance!

Regards,
Tineke

Daniel
Telerik team
 answered on 11 Jun 2010
2 answers
107 views
Go to the Menu Overlay demo page.

Clicking on items on the menu does exactly what you'd expect; it overlays the dropdown box and the flash movie.

Now click on the dropdown to open the list. With the dropdown open, hover over the menu. The menu still overlays the dropdown control but fails to overlay the dropped down list.

I've tried this in IE8 and chrome, but YMMV.
-- 
Stuart
Stuart Hemming
Top achievements
Rank 2
 answered on 11 Jun 2010
4 answers
448 views
Telerik.WebControls.RadPanelItemCollection must have items of type 'Telerik.WebControls.RadPanelItem'. 'RadP:RadPanelBar' is of type 'Telerik.WebControls.RadPanelbar'

I added the dll to bin folder and still on aspx page it is showing error "Element Radpanelbar is not known element.."

what else I need to do?
jaws1021
Top achievements
Rank 1
 answered on 11 Jun 2010
4 answers
225 views
Hi,

I have been going through instances to populate the Grid from xml. But, my issue is I want to use the DOM model to populate the grid dynamically from Server side.
If I have a xml that looks something like this:
<Listing> 
  <Customer Name="Browning Bob" CustNumber="345" CustomerID="1" Address="123 Street1, 1 Coast, UK 89869" /> 
  <Customer Name="Williams" CustNumber="235" CustomerID="2" Address="123 Street2, Coast2, UK 89863" /> 
</Listing> 
I create an instance of xmldocument and try to load this xml into it but it says: data at root level is invalid.
Would be great if provided with sample code to use xpath + xmldom to populate the columns Name, CustNumber and Address dynamically from server side. Also, Please suggest, how to get paging controlled.
smith spd
Top achievements
Rank 1
 answered on 11 Jun 2010
1 answer
198 views
Hi,

I have a RadGrid control with databound from SQL server. One of the columns is string datatype that contains XML. When the data is displayed, I want the raw xml to show including the XML tags. Right now, what it does is dropping xml tags. I've changed string datatype in DB column to XML datatype. It seems to be the same


How can I set my grid to do this?

ps. Currently, the colums of my grid is autogenerated.


Thanks..
Daniel
Telerik team
 answered on 11 Jun 2010
1 answer
438 views

Few Issues with below xml:

<?xml version="1.0" encoding="utf-8"?>  
<Results> 
  <Products xmlns="">  
    <DesignDate>06/15/2005</DesignDate> 
    <SoldDate>06/30/2006</SoldDate> 
    <Product_No.>7289</Product_No.> 
    <Customer>Thomas</Customer> 
    <Product_Type>Accessories</Product_Type> 
    <Price_Today>380</Price_Today> 
  </Products> 
  <Products xmlns="">  
    <DesignDate>12/14/2004</DesignDate> 
    <SoldDate></SoldDate>  
    <Product_No.>3136</Product_No.> 
    <Customer>Karie</Customer> 
    <Product_Type>Electronics</Product_Type> 
    <Price_Today>333</Price_Today> 
  </Products> 
</Results> 

1) How to bind this xml Using DOM Model to RadGrid from serverside? I don't want to pull xmldatasource and gridview with columns on FRONT end(aspx).
2) How to dynamically bind the nodes DesignDate, SoldDate....as columns to RadGrid with Data? b'coz there can be many columns with different column names and I don't to specify each by saying: HeaderText="DesignDate". I would like to generate this dynamically from serverside.
Would be great if provided with a code to make this working.

Daniel
Telerik team
 answered on 11 Jun 2010
2 answers
91 views
I am using the following code from this example to dynamically pull products based on quote number.
 
protected void Review_RadToolTipManager_AjaxUpdate(object sender, ToolTipUpdateEventArgs e) 
    { 
        Control ctrl = Page.LoadControl("Quote_Detail.ascx"); 
        e.UpdatePanel.ContentTemplateContainer.Controls.Add(ctrl); 
        ((Label)ctrl.FindControl("lblQuoteID")).Text = e.Value; 
    } 
    protected void Review_RadGrid_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem) 
        { 
            Review_RadToolTipManager.TargetControls.Add(e.Item.ClientID, ((DataRowView)e.Item.DataItem)["QuoteID"].ToString(), true); 
        } 
    } 

However, when I filter the grid or group it the values won't update on the rows. Do I need to rebind the grid on any function that would change row order of quote ids?
Ian Welsh
Top achievements
Rank 1
 answered on 11 Jun 2010
4 answers
246 views
Hi,

I have created a RadNumericTextbox control and set the NumberFormat's properties. Everything is displayed correctly, but how can I get programmatically the formatted text.

i.e.

A control displays: $ 1,223.34

in code:

string value = control.Text;

and the value equals 1223.34 and I want to get $ 1,223.34

Thanks in advance
Michal Siudyka
Top achievements
Rank 2
 answered on 11 Jun 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?