Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
260 views
I need to create a grid entirely by code, assigning it some custom columns (GridTemplateColumn) and theses columns have HeaderTemplate, ItemTemplate and EditItemTerplate set with a custom class wich implements ITemplate.
I just followed this article : http://www.telerik.com/help/aspnet/grid/grdprogrammaticcreation.html
Each of my columns use an new instance of the same 'Itemplate class'

here is the content of InstanciateIn method into ItemTemplate class :
public void InstantiateIn(Control container)
        {
            ctrlAcquis = new Literal();
            ctrlAcquis.DataBinding += new EventHandler(ctrl1_DataBinding);
            Table tb = new Table(); 
            TableRow r = new TableRow();
            TableCell c1 = new TableCell();
            TableCell c2 = new TableCell();
            r.Cells.Add(c1);
            r.Cells.Add(c2);
            tb.Rows.Add(r);
  
            c1.Controls.Add(ctrlAcquis);
                          
            container.Controls.Add(tb);
        }

It is working fine !

But now, to be able to export this custom cxolumns in CSV format, I see here : http://www.telerik.com/help/aspnet-ajax/grid-csv-export.html that I need to Iterate throught each of my items , use FindControl to find my Literal, get content and assign it to my item Text property. Something like that :
foreach(GridDataItem item in RadGrid1.MasterTableView.Items)
   {
       Image img = item["MyColumn"].FindControl("Image1") as Image;
       item["MyColumn"].Text = img.AlternateText;
   }

OK, so I need to assign a ID to my LiteralctrlAcquis
Here is the new code of my item template :
public void InstantiateIn(Control container) 
        { 
            ctrlAcquis = new Literal(); 
            ctrlAcquis.ID = "ctrlAcquis";
            ctrlAcquis.DataBinding += new EventHandler(ctrl1_DataBinding); 
            Table tb = new Table();  
            TableRow r = new TableRow(); 
            TableCell c1 = new TableCell(); 
            TableCell c2 = new TableCell(); 
            r.Cells.Add(c1); 
            r.Cells.Add(c2); 
            tb.Rows.Add(r); 
    
            c1.Controls.Add(ctrlAcquis); 
                            
            container.Controls.Add(tb); 
        }

My grid show up ok at first display, but at the first postback I got this error :
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Multiple controls with the same ID 'ctrlAcquis' were found. FindControl requires that controls have unique

How to set up unique id on all instance of my item template, but stay able to use FindControl("ctrlAcquis") ?
Do I need to name my control with the name of the custom colum for instance because each of my columns use the same Itemplate class ?

p.s: I'm using version 2010.1.519.35 of Telerik RadControls for ASP.NET Ajax

Thanks for help !

 
Rosen
Telerik team
 answered on 02 Sep 2010
1 answer
119 views
Hi,

Like radschedular can radcalendar be used to design a web form from thich the user can mark his leave plan easily.

If not which control can be used


Thanks

Milind
Shinu
Top achievements
Rank 2
 answered on 02 Sep 2010
1 answer
302 views
I have a Master/Detail grid and have added some buttons with custom command names in my details grid and have attached this script to the client OnCommand event. (I have omitted code that is not relevant).

function OnCommand(sender, eventArgs)
{
      // code omitted here that used radConfirm to get user to approve the selected command
      //  ...
      // code which is executed if user confirms selected command
    var grid = sender;
    var MasterTable = grid.get_masterTableView();
    itemIndex = eventArgs.get_commandArgument();
    masterTable.fireCommand("MyCustomCommand", itemIndex);
}

The code triggers successfully but the problem is that the GridCommandEventArgs that I receive in the code-behind event (RadGrid1_ItemCommand) contains item data only for the parent row. How can I retrieve the item data for the child row that triggered the command?

I have also noticed that if I set the FireCommand method to trigger a "Delete" command, then the GridCommandEventArgs does contain the child row data, but when I change it to a custom command name, it then only sends the parent row data.

 I need to be able to at least retrieve the datakey values for the child row.


Princy
Top achievements
Rank 2
 answered on 02 Sep 2010
1 answer
131 views
I don't use icons in my menu and this area doesn't look good without icons.
Cori
Top achievements
Rank 2
 answered on 01 Sep 2010
2 answers
154 views
I am interested in setting the output columns of my RadGrid based on the checked columns (true or false) selected by the user.

As an example, lets say I have ten default columns returned to my datagrid, but the user only wants to display 5 of those. Can anyone point me in the right direction?

Thanks in advance.
Royal
Top achievements
Rank 1
 answered on 01 Sep 2010
3 answers
184 views
I was made aware of the Multiple Selection on Macs not working for the RadListBox - when trying to use the Command (Control-equivalent on PC)-Click combination.

The Shift-Click combination works fine - for selecting multiple items in a row.

The Command-Click - cherry picking method for multiple selection does not work. I am trying this on Safari, and it did not work on the Telerik Demo application. I was also told that this is non-working on Firefox.

 http://demos.telerik.com/aspnet-ajax/listbox/examples/default/defaultcs.aspx

For sanity purposes, I used a standard asp.net listbox control, and the multiple selection with Command-Click works fine.

I searched the forums, but did not find any reference to this. Is this a known issue?


Nikolay Tsenkov
Telerik team
 answered on 01 Sep 2010
3 answers
182 views
Hi,   
     Intellisense doesn't seem to work in ASPX pages for Telerik controls, in our project.
          1) The assemblies(Telerik.Web.UI & Telerik.Web.Design) are added to the GAC 
          2) The 'web.config' refers to the latest dll's of the same.
          3) The assembly is also registered in the ASPX page like below:

                <%

@ Register Assembly="Telerik.Web.UI", Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
          4) Intellisense is working fine in the code behind files.

   But, still it doesn't seem to work in the ASPX files alone. Can you please suggest a solution to enable intellisense to show up in the ASPX pages also for Telerik controls ? 

    We are using Visual Studio 2008 with SP1.

Thanks & Regards,
Karthik.
  
   

 

Peter
Telerik team
 answered on 01 Sep 2010
5 answers
309 views
Dears,
In radGrid Template I have radcombobox and a button, when user clicks the button I open a radwindow to let hime insert new choice, if user click ok in the radwindow dialog I have to add a new item to radcombobox item.
I am call javascript function in the main page from the dialog. this function fire the ajaxRequest of RadAjaxManger.
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest();
In the ajaxrequest handler I tried to get the radcombobox of the radgrid template as following:
Dim GridItem As GridDataItem = CType(grdTrngs.EditItems(0), GridDataItem)
Dim cmbDocs As RadComboBox = GridItem.FindControl("cmbTrngsHR_DOCS_ID")
but it didn't work and the FindControl retuen nothing.
So, could you please help in
Thanks in Advance
Best Regards


 

 

 

Pavlina
Telerik team
 answered on 01 Sep 2010
11 answers
313 views
Hi, I hope someone can help me with the following issue - It seems like there is a problem with the javascript when using the RadNumericTextBox with a ValidatorCalloutExtender.

It seems like the problem is caused when page tries to dispose of the CalloutValidator.

To reproduce the issue, slap a simple webform together that looks something like this:
        <telerik:RadScriptManager runat="server" ID="rsm"></telerik:RadScriptManager> 
        <telerik:RadNumericTextBox ID="txtAmount" Runat="server"></telerik:RadNumericTextBox> 
        <asp:RangeValidator runat="server" id="rv1" MinimumValue=0 MaximumValue=1 ControlToValidate="txtAmount" ErrorMessage="Please fix"></asp:RangeValidator> 
        <ajaxControlToolkit:ValidatorCalloutExtender runat="Server" ID="vcerv1" TargetControlID="rv1" /> 
        <asp:Button runat="server" Text="Save" ID="btnSave"  /> 
        
Now, run it and enter an invalid value in the txtAmount textbox to get the CalloutExtender to pop up. Now press F5 - I get a "'_events' is null or not an object" javascript exception. Looking at the stack trace - this seems to stem from some cleanup method called by the browser on page unload. 

Am I doing something wrong, or is this a known issue - I had a look at the existing posts in the forum and couldn't find anything about this issue.

Thank you,
Peter

AjaxControlToolkit.dll : v3.0.20820.16598
Telerik.Web.UI.dll : v2008.2.1001.35
Dimo
Telerik team
 answered on 01 Sep 2010
2 answers
133 views
I have a table "template" on my page, and the tbody is the XmlHttpPanel...idea was to return just the <tr>s and <td>s which make up the panel (from the webservice) seeing as the headers and footers are rather large, and really all the same (never change).

...ok so the issue I'm having is that in this context the panel renders ABOVE the table (in firefox, havent tested others yet).

<div>
    <table>
        <thead>
            ...HEADERS
        </thead>
        <tbody>
           <telerik:RadXmlHttpPanel ID="workflowPanel" runat="server" WebMethodName="GetWorkflow" RenderMode="Block" WebMethodPath="~/Apps/RTO/Webservices/WorkflowChain.asmx" OnClientResponseEnding="onWorkflowEnding" OnClientResponseEnded="onWorkflowEnded" OnClientResponseError="onWorkflowError" EnableViewState="false" >
 
                </telerik:RadXmlHttpPanel>
        </tbody>
    </table>
</div>

Why would that be?...firefox not liking the div of the panel?
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 01 Sep 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?