Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
103 views
Hello
I use a RadGrid and I actived grouping. In Source with bind the RadGrid I have full date (format: DD:MM:YYYY:HH:MM:SS).
Result is such I have group for one Item.
I will have group by DD:MM:YYYY. One groups is have item for one day.
Can you hell mi ??

Michał Nikołajuk
Top achievements
Rank 2
 answered on 22 Dec 2008
1 answer
87 views
Hi All,

I have designed a page that contains a rad grid in ajax updatepanel, I  have made rows editable by double click row, but when double click row ajax action fired and grid reloaded keeping row editable, if I update this row and click new row to update changes I have applied to first row gone, means that I have to double click all rows I want to edit first then update all after that, and I think this is not a user experience, so anyway to make double click row to be editable client side event and ajax not fired to not reload grid items??(EditMode=InPlace).

Please advise.

Regards
Shinu
Top achievements
Rank 2
 answered on 22 Dec 2008
1 answer
141 views
Hi all!

Please have a look here ...

I can say "Sure, this is a RadMenu", but I wonder which one? And how it is been done? I mean the picts at he bottom of each menu item and the two column menus ... UF, such a Heigh Tech.!

Most important, could it be generated through a data source like a database? Which columns should the database have?

Thanks for the answer :)


Princy
Top achievements
Rank 2
 answered on 22 Dec 2008
1 answer
101 views
Hi:

I've just moved from RadControls classic to RadControls for Ajax so I'm exploring the many examples, etc.  I came across the demo on inserting and update grid on client-side.  It's cool and all, but I'm not sure what use these features have.

I mean, most grid data are from database backend, so you can update and insert all you want on the client-side, but without travelling back to the server, the changes won't persist.  In fact, couldn't this whole client-side update cause a LOT of confusion, especially among less web-savvy users.  I mean, they click the update button, they see the changes on screen real fast, they're happy and go for coffee, they come back and the session is over. They re-log on and all the changes are gone.  And they're all confused as to why.

So, I'm not sure under what circumstances should client update or insert be used.  To be honest, I can think of any. Am I missing something?

I'd really appreciate some feedback/clarification on this!

Justin
Vlad
Telerik team
 answered on 22 Dec 2008
2 answers
172 views
I want to popup a confirmation window after inserting a row in my radGrid, that would say something like "The record has been saved with id 12345 etc ".

But how can I do this? I can only find ways to open a radWindow using client side methods. I was hoping to open the window from within the ItemInserted handler, but I can't figure out how.

Can anyone help please?

Thanks, Steve
Steve Newbery
Top achievements
Rank 1
 answered on 21 Dec 2008
2 answers
122 views

How can we alter this case

 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>  
 
<%@ Register TagPrefix="radG" Namespace="Telerik.WebControls" Assembly="RadGrid.Net2" %>  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml">  
<head id="Head1" runat="server">  
    <title>Untitled Page</title>  
</head>  
<body>  
    <form id="form1" runat="server">  
        <div>  
            <radG:RadGrid ID="RadGrid1" EnableAJAX="True" DataSourceID="mainTableSource" runat="server" 
                Width="95%" AutoGenerateColumns="False" PageSize="5" AllowSorting="True" Skin="Windows" 
                AllowPaging="True" AllowAutomaticUpdates="True" AllowAutomaticInserts="True" 
                AllowAutomaticDeletes="True" OnInsertCommand="RadGrid1_InsertCommand" ShowStatusBar="true">  
                <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>  
                <MasterTableView DataSourceID="mainTableSource" CommandItemDisplay="Top" DataKeyNames="EmployeeID" 
                    AllowMultiColumnSorting="True" AllowAutomaticDeletes="true" AllowAutomaticUpdates="true" 
                    AllowAutomaticInserts="true">  
                    <DetailTables>  
                        <radG:GridTableView DataKeyNames="EmployeeID, OrderID" DataSourceID="nestedTableSource" 
                            Width="100%" runat="server" AllowAutomaticDeletes="true" AllowAutomaticInserts="true" 
                            AllowAutomaticUpdates="true" CommandItemDisplay="Top">  
                            <ParentTableRelation>  
                                <radG:GridRelationFields DetailKeyField="EmployeeID" MasterKeyField="EmployeeID" />  
                            </ParentTableRelation>  
                            <Columns>  
                                <radG:GridBoundColumn SortExpression="OrderID" HeaderText="OrderID" HeaderButtonType="TextButton" 
                                    DataField="OrderID" UniqueName="OrderID" ReadOnly="true">  
                                </radG:GridBoundColumn>  
                                <radG:GridBoundColumn SortExpression="ShipVia" HeaderText="Ship via" HeaderButtonType="TextButton" 
                                    DataField="ShipVia" UniqueName="ShipVia">  
                                </radG:GridBoundColumn>  
                                <radG:GridBoundColumn SortExpression="ShipName" HeaderText="Ship name" HeaderButtonType="TextButton" 
                                    DataField="ShipName" UniqueName="ShipName">  
                                </radG:GridBoundColumn>  
                                <radG:GridBoundColumn SortExpression="ShipCity" HeaderText="Ship city" HeaderButtonType="TextButton" 
                                    DataField="ShipCity" UniqueName="ShipCity">  
                                </radG:GridBoundColumn>  
                                <radG:GridBoundColumn SortExpression="ShipCountry" HeaderText="Ship country" HeaderButtonType="TextButton" 
                                    DataField="ShipCountry" UniqueName="ShipCountry">  
                                </radG:GridBoundColumn>  
                                <radG:GridEditCommandColumn UniqueName="EditCommandColumn" />  
                                <radG:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" CommandName="Delete" />  
                            </Columns>  
                        </radG:GridTableView>  
                    </DetailTables>  
                    <Columns>  
                        <radG:GridBoundColumn SortExpression="FirstName" HeaderText="First name" HeaderButtonType="TextButton" 
                            DataField="FirstName" UniqueName="FirstName">  
                        </radG:GridBoundColumn>  
                        <radG:GridBoundColumn SortExpression="LastName" HeaderText="Last name" HeaderButtonType="TextButton" 
                            DataField="LastName" UniqueName="LastName">  
                        </radG:GridBoundColumn>  
                        <radG:GridBoundColumn SortExpression="Address" HeaderText="Address" HeaderButtonType="TextButton" 
                            DataField="Address" UniqueName="Address">  
                        </radG:GridBoundColumn>  
                        <radG:GridBoundColumn SortExpression="City" HeaderText="City" HeaderButtonType="TextButton" 
                            DataField="City" UniqueName="City" />  
                        <radG:GridBoundColumn SortExpression="Country" HeaderText="Country" HeaderButtonType="TextButton" 
                            DataField="Country" UniqueName="Country">  
                        </radG:GridBoundColumn>  
                        <radG:GridEditCommandColumn UniqueName="EditCommandColumn" />  
                        <radG:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" CommandName="Delete" />  
                    </Columns>  
                </MasterTableView>  
            </radG:RadGrid>  
            <asp:SqlDataSource ID="mainTableSource" SelectCommand="SELECT [EmployeeID], [LastName], [FirstName], [Address], [City], [Country] FROM [Employees]" 
                runat="server" ConflictDetection="CompareAllValues" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" 
                DeleteCommand="DELETE FROM [Employees] WHERE [EmployeeID] = @original_EmployeeID" 
                InsertCommand="INSERT INTO [Employees] ([LastName], [FirstName], [Address], [City], [Country]) VALUES (@LastName, @FirstName, @Address, @City, @Country)" 
                OldValuesParameterFormatString="original_{0}" UpdateCommand="UPDATE [Employees] SET [LastName] = @LastName, [FirstName] = @FirstName, [Address] = @Address, [City] = @City, [Country] = @Country WHERE [EmployeeID] = @original_EmployeeID AND [LastName] = @original_LastName AND [FirstName] = @original_FirstName AND [Address] = @original_Address AND [City] = @original_City AND [Country] = @original_Country">  
                <DeleteParameters>  
                    <asp:Parameter Name="original_EmployeeID" Type="Int32" />  
                </DeleteParameters>  
                <UpdateParameters>  
                    <asp:Parameter Name="LastName" Type="String" />  
                    <asp:Parameter Name="FirstName" Type="String" />  
                    <asp:Parameter Name="Address" Type="String" />  
                    <asp:Parameter Name="City" Type="String" />  
                    <asp:Parameter Name="Country" Type="String" />  
                    <asp:Parameter Name="original_EmployeeID" Type="Int32" />  
                    <asp:Parameter Name="original_LastName" Type="String" />  
                    <asp:Parameter Name="original_FirstName" Type="String" />  
                    <asp:Parameter Name="original_Address" Type="String" />  
                    <asp:Parameter Name="original_City" Type="String" />  
                    <asp:Parameter Name="original_Country" Type="String" />  
                </UpdateParameters>  
                <InsertParameters>  
                    <asp:Parameter Name="LastName" Type="String" />  
                    <asp:Parameter Name="FirstName" Type="String" />  
                    <asp:Parameter Name="Address" Type="String" />  
                    <asp:Parameter Name="City" Type="String" />  
                    <asp:Parameter Name="Country" Type="String" />  
                </InsertParameters>  
            </asp:SqlDataSource>  
            <asp:SqlDataSource ID="nestedTableSource" SelectCommand="SELECT [OrderID],[EmployeeID], [ShipVia], [ShipName], [ShipCity], [ShipCountry] FROM [Orders] WHERE ([EmployeeID] = @EmployeeID)" 
                runat="server" ConflictDetection="CompareAllValues" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString2 %>" 
                DeleteCommand="DELETE FROM [Orders] WHERE [OrderID] = @original_OrderID" InsertCommand="INSERT INTO [Orders] ([EmployeeID], [ShipVia], [ShipName], [ShipCity], [ShipCountry]) VALUES (@EmployeeID, @ShipVia, @ShipName, @ShipCity, @ShipCountry)" 
                OldValuesParameterFormatString="original_{0}" UpdateCommand="UPDATE [Orders] SET [ShipVia] = @ShipVia, [ShipName] = @ShipName, [ShipCity] = @ShipCity, [ShipCountry] = @ShipCountry WHERE [OrderID] = @original_OrderID AND [ShipVia] = @original_ShipVia AND [ShipName] = @original_ShipName AND [ShipCity] = @original_ShipCity AND [ShipCountry] = @original_ShipCountry">  
                <SelectParameters>  
                    <asp:SessionParameter Name="EmployeeID" SessionField="EmployeeID" Type="Int32" Direction="Input" />  
                </SelectParameters>  
                <DeleteParameters>  
                    <asp:Parameter Name="original_OrderID" Type="Int32" />  
                </DeleteParameters>  
                <UpdateParameters>  
                    <asp:Parameter Name="ShipVia" Type="Int32" />  
                    <asp:Parameter Name="ShipName" Type="String" />  
                    <asp:Parameter Name="ShipCity" Type="String" />  
                    <asp:Parameter Name="ShipCountry" Type="String" />  
                    <asp:Parameter Name="original_OrderID" Type="Int32" />  
                    <asp:Parameter Name="original_ShipVia" Type="Int32" />  
                    <asp:Parameter Name="original_ShipName" Type="String" />  
                    <asp:Parameter Name="original_ShipCity" Type="String" />  
                    <asp:Parameter Name="original_ShipCountry" Type="String" />  
                </UpdateParameters>  
                <InsertParameters>  
                    <asp:SessionParameter Name="EmployeeID" SessionField="EmployeeID" Type="Int32" />  
                    <asp:Parameter Name="ShipVia" Type="Int32" />  
                    <asp:Parameter Name="ShipName" Type="String" />  
                    <asp:Parameter Name="ShipCity" Type="String" />  
                    <asp:Parameter Name="ShipCountry" Type="String" />  
                </InsertParameters>  
            </asp:SqlDataSource>  
        </div>  
    </form>  
</body>  
</html>  
 

 

 

..to add one more nested table with DataKeyNames="EmployeeID, OrderID, newColumnID" ?

 

Thank you!

Stavros
Top achievements
Rank 1
 answered on 21 Dec 2008
0 answers
107 views
Hello,
   I'm trying to bind a RadPanel to Two database tables.   I would like the headers to bind to a department table and expand to display a list of categories in that department.  I'm close to getting this working, but I'm ending up with one Header (with the xml root node displayed) and expanding to display departments. I think I'm off a level, but can't seem to make it work.  I tried xpath = /departments/department but it displays nodes instead of attribute( "department" instead of "department name").   Here's my code.   If there's a completely different approach, I'm willing to try it.   Thanks in advance for any help.

//From Access class, this works fine with standard treeview.

public

 

static string GetMenuItemsFromSQL()

 

 

 {

string xml = string.Empty; 
string queryString = @"SELECT Department.Name AS name, Department.DepartmentID AS id, 
Department.Description AS desription, Category.Name AS name,

 

 

Category.CategoryID AS id

FROM Department AS department INNER JOIN

Category AS category ON department.DepartmentID = category.DepartmentID

ORDER BY department.DepartmentID

FOR XML Auto, ROOT('departments')";

 

string connectionString = WebSiteConfiguration.DbConnectionString; 
 

 

 

using (SqlConnection connection = new SqlConnection(connectionString))

{

SqlCommand SelectCommand = new SqlCommand(queryString, connection); 
connection.Open();
XmlReader xr = SelectCommand.ExecuteXmlReader(); 
xr.MoveToContent();
xml = xr.ReadOuterXml();

 

}

return xml; 
}

//.cs page
protected void Page_Load(object sender, EventArgs e) 
{

 

XmlDataSource1.Data =

CatalogAccess.GetMenuItemsFromSQL();
}

//.ascx
<telerik:RadPanelBar ID="RadPanelBar1" Runat="server" Skin="Web20" ExpandMode="SingleExpandedItem"
DataSourceID="XmlDataSource1" >
 
<CollapseAnimation Type="None" Duration="100"></CollapseAnimation>

 
<DataBindings
    
<telerik:RadPanelItemBinding DataMember="department" Depth="1" TextField="name" />
    
<telerik:RadPanelItemBinding DataMember="category" Depth="2" TextField="name" /> 
</DataBindings>

 

 

 

<

 

ExpandAnimation Type="None" Duration="10"></ExpandAnimation
</
telerik:RadPanelBar

<
asp:XmlDataSource ID="XmlDataSource1" runat="server" ></asp:XmlDataSource>
 

 

 

 

 

Everett
Top achievements
Rank 1
 asked on 21 Dec 2008
2 answers
98 views
HI,
First off let me say that I LOVE the treeview in the combo trick!
There is one thing I would like to do that I have quite figured out though.
In the OnClientDropDownOpenedHandler, you typically write come something like:
var tree = sender.get_items().getItem(0).findControl(treeid); 
Where treeid is whatever the id is of the tree in the combo.
This is great if you have only one combox/treeview control on the. I'm trying to figure out how to genericise the function.
Right now I have to hard code the control ids in a switch as shown below.

 

 

function OnClientDropDownOpenedHandler(sender, eventArgs)  
{  
var treeid = "";  
switch (sender.get_id())  
{  
     case "Master_cntPageBody_ddlOffsetAccount":  
     treeid = "tvOffsetAccount";  
     break;  
}  
var tree = sender.get_items().getItem(0).findControl(treeid);  
 

What I'd really like to do is to be able to get the id of the tree somehow at runtime so I don't have to have this switch. Is this possible?
Something  along the lines of 
sender.get_items().getItem(0).Controls(0).get_id();.
I know this doesn't exist but is there some way to get the same effect?
THanks ... Ed

 

Ed Staffin
Top achievements
Rank 1
 answered on 21 Dec 2008
1 answer
172 views
I have transfered my application from my old laptop which was running Version=2008.2.826.35
to my new laptop which is running the latest build.
At the old laptop I had to add this line in the web.config file :

<add name="Telerik.Web.UI.WebResource" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2008.2.826.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" />

Should I retain this line with the new version, should I delete it or should I alter the version number?
Thank you very much.
Dimo
Telerik team
 answered on 21 Dec 2008
3 answers
100 views
According to this:
http://www.telerik.com/help/aspnet-ajax/menu_appearancecontrollingappearance.html

-->Use the Height and Width properties to limit the dimensions of the menu. If the Width of a horizontal menu is too small to display all of its root items, the menu automatically creates additional rows:

I dont want it to automatically add a new row, rather I would like scroll bars because otherwise it stuffs up the layout of the whole page.

How can I do this?

Matthew Bishop
Top achievements
Rank 1
 answered on 21 Dec 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?