Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
143 views
Hi,

I am using the Datagrid as Listview as in this example:
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/listview/defaultcs.aspx
I added a DataKeyField and created an ItemCommand eventhandler which fires fine using EnablePostbackOnRowClick. The problem is that I get the same DataKeyValue codebehind for each source record I click on. Can you show me a way out of this problem?

Regards,
Ingo
Tsvetoslav
Telerik team
 answered on 16 Apr 2009
1 answer
215 views
Hello,

For the past hours, I tried different ways to perform insert and delete of rows on client-side, without success.

Basically, I use a Web Service to make the insertions but I would like to be able to insert that new row on client instead of getting a whole new datasource from the server for just adding that new row. Same thing with deleting a row.

These are the different calls I'm trying to accomplish :

var grid = $find("<%=RadGrid1.ClientID%>");
var tableview = $find("<%=RadGrid1.ClientID%>").get_masterTableView();

// For inserting
tableview.insertItem("");    //Throw an error
tableview.fireCommand("InitInsert", "");   // Do nothing

// For deleting
tableview.deleteItem(myIndex);    // Do nothing
tableview.deleteSelectedItems(); // Do nothing
tableview.fireCommand("Delete", myIndex);  // Do nothing


I also setted the options AllowAutomaticDeletes and AllowAutomaticInserts to true on my MasterTableView, but with no success.

This is a MUST to be able to inserting/updating/deleting rows on the client! Please help!

Thanks in advance!
Pierre-Luc

Princy
Top achievements
Rank 2
 answered on 16 Apr 2009
0 answers
146 views
Hi All,

I have created a custom page layout in sharepoint. In the layout I am adding a "RadComboBox" and in the ItemTemplate of this RadComboBox I am adding a "RadTreeView" control like below.


<telerik:RadComboBox ID="RadComboBox1" runat="server"
            EnableItemBindingExpressions="true" HighlightTemplatedItems="True" OnClientSelectedIndexChanging="changing" >
          <Items>
              <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem1"
                  Value="RadComboBoxItem1" />
          </Items>
          <ItemTemplate>
              <div>
                  <telerik:RadTreeView ID="RadTreeView1" Runat="server" CheckBoxes="True" Skin="Black" >
                    <Nodes>
                            <telerik:RadTreeNode runat="server" Text="Node1" Value="Node1">
                                <Nodes>
                                    <telerik:RadTreeNode runat="server" Text="ChildNode 1" Value="ChildNode 1">
                                    </telerik:RadTreeNode>
                                    <telerik:RadTreeNode runat="server" Text="ChildNode 2" Value="ChildNode 2">
                                    </telerik:RadTreeNode>
                                </Nodes>
                            </telerik:RadTreeNode>
                            <telerik:RadTreeNode runat="server" Text="Node2" Value="Node2">
                                <Nodes>
                                    <telerik:RadTreeNode runat="server" Text="ChildNode 1" Value="ChildNode 1">
                                    </telerik:RadTreeNode>
                                </Nodes>
                            </telerik:RadTreeNode>
                    </Nodes>
    </telerik:RadTreeView>
              </div>
          </ItemTemplate>
<FooterTemplate>FOOTER</FooterTemplate>
    </telerik:RadComboBox>

This is working fine in the simple web application showing the tree view control in the Combo box  control.
But in my custom page layout it is not showing the tree view control.
Is there any work around for this.

Thanks in Advance
Alok...
Alok
Top achievements
Rank 1
 asked on 16 Apr 2009
2 answers
104 views
I'm sure I'm missing something stupid but I've been staring at this for too long . . .

I have a two-level hierarchical grid: invoices and shipments that are associated with each invoice.  In the ItemCreated event for the grid I'm setting properties for a HyperLink column which will call a JavaScript funtion to open a shipment detail window.  One parameter for this function is a piece of information (approvalStatus) that exists at the MasterTableView level rather than the DetailTables level.  My efforts to retrieve this value have so far proven fruitless.  

Any pearls of wisdom?  Thank you in advance.

protected void grdInvoices_ItemCreated(object sender, GridItemEventArgs e)  
    {  
        if (e.Item is GridDataItem)  
        {              
            //String approvalStatus = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["INVOICE_ID"].ToString();              
            if (e.Item.OwnerTableView.Name == "DetailTable")  
            {  
                HyperLink viewLink = e.Item.FindControl("ViewLink") as HyperLink;  
                viewLink.Attributes["href"] = "#";  
                viewLink.Text = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["shipment_id"].ToString();  
                viewLink.Attributes["onclick"] = string.Format("return ShowProbillWindow('" + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["shipment_id"] + "', '" + approvalStatus + "');");                  
            }  
        }  
            } 

 

Shinu
Top achievements
Rank 2
 answered on 16 Apr 2009
2 answers
95 views
The drop down boxes will flip up above the combobox when they get near the bottom of the screen while  the user is scolling in their browser.

The help file says this is actually "automatic" behavior:

The drop-down list automatically expands to the opposite direction when the screen boundaries would otherwise be crossed.

I need it to always show up below the combobox, how do we prevent this functionality from occuring.  Version is latest 2008 Q3.

Thanks!
Ron Trotto
Top achievements
Rank 1
 answered on 16 Apr 2009
2 answers
96 views
I've put the following code below my scheduler:

var Scheduler = $find("<%=RadScheduler.ClientID%>"); 

But then when I call (in Firebug)

console.log(Scheduler); 

It returns null.

I managed to work around it by handling the OnClientDataBound event . . . . I just save the "sender" parameter as a global variable.

But now I need a reference to a RadAjaxManager. Since I can't seem to use the $find() syntax, and since RadAjaxManager doesn't have an equivalent event I can handle as a workaround, what can I do to get a client-side reference?

(I'm using jQuery if that affects anything)

Thank you,

Michael
Michael Kane
Top achievements
Rank 1
 answered on 16 Apr 2009
1 answer
193 views
Hi,

Can someone please tell me what is the best way to handle errors on a page displayed within a RadWindow?  I would like to handle the Page.Error event, but for some reason, this doesn't seem to fire when my page is displayed in a RadWindow.  I have also tried handle the ScriptManager.AsyncPostBackError event but it also doesn't seem to fire.  I can get the Application_Error to fire in Global.asax, but I can't get a reference to the Page to properly handle my errors from there.

What I am trying to acheive is to have my error handler catch all AuthenticationExceptions and redirect to the login page.  However, if the page is actually a RadWindow, I don't want to redirect the RadWindow to the login page, I actually want to redirect the parent page to the login window.  I tried to use the Context.Handler from within Application_Error to determine the type of the page that caused the error, but this is null when the error is raised by a RadWindow, so I have no way to get a reference to the parent window to redirect it.  My solution was instead to have all pages that open in a RadWindow use a given MasterPage, and then handle the Page.Error event within the MasterPage, but unfortunately, this doesn't fire.  So I tried to handle it directly within the Page, but Page.Error doesn't seem to fire either.  Next I tried ScriptManager.AsyncPostBackError, but had no luck.  In every case, I manually listened to the event using eg. Page.Error += Page_Error;

Any suggestions?

Thanks,

Billy

Billy
Top achievements
Rank 1
 answered on 15 Apr 2009
2 answers
181 views
Hi,

It looks like the custom attributes don't get set any-more when using (for example):
treeView.LoadXmlString(newDoc.OuterXml)

a node from my XML string looks like:
<Node ImageUrl="~/images/TaskRes.gif" Text="the task" Value="{9400594D-10D0-426D-813E-84B9E3811587}" Category="rstrt" Expanded="true">

I want to be able to later access the attribute 'Category'.  This all last worked in the RadControls 2007 Q3 classic version, why not now?

thanks

ps. I've also tried using treeView.LoadXml(newDoc.OuterXml), same result!
Feizal Amlani
Top achievements
Rank 1
 answered on 15 Apr 2009
3 answers
125 views
Due to circumstances beyond my control we have to use IE6 in our corporate environment and Ie6 support is claimed however I get this wierd alignment error in IE6.

http://img.photobucket.com/albums/v367/aurablue/misAlignedIe.jpg

It works fine in Chrome and FF however IE6 is the supported browser in the comapany.

Is this known? Is there anything that can be done?




Rick
Top achievements
Rank 1
 answered on 15 Apr 2009
6 answers
129 views
Is there a way to specify the size of the textboxes for the AutoGenerated Edit in the aspx page?
I have set MaxLength and also tried ItemStyle Width=100px but they do not affect the textbox width.

Or can this only be done with use FormTemplate?
Lenny_shp
Top achievements
Rank 2
 answered on 15 Apr 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?