Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
232 views
Hi,

I have a radGrid to which I need to give links to few columns and I am doing as given below:

protected void radGrid_PreRender(object sender, EventArgs e)
        {
            foreach (GridDataItem dataItem in radGrid.Items)
            {
                foreach (GridColumn col in radGrid.MasterTableView.RenderColumns)
                {
                    if (col.ColumnType == "GridBoundColumn")
                    {
                        if (col.UniqueName == "CardNumber")
                        {
                            string celltxt = dataItem[col.UniqueName].Text;
                            LinkButton link = new LinkButton();
                            link.Text = celltxt;
                            link.PostBackUrl = string.Format("CardDetails?CardNo={0}", link.Text);
                            dataItem[col.UniqueName].Controls.Clear();
                            dataItem[col.UniqueName].Controls.Add(link);
                        }
                    }
                }
            }
        }


My issue is the postbackurl for the linkbutton is not dependent on a single/current cell value. Its depends on other cells as well. This can be something as given below:

link.PostBackUrl = string.Format("CardDetails?CardNo={0}?AccountID={1}", link.Text,?????);

I dont know how to get AccountID value which is there on the other cell and to my luck it can be invisible in many cases. When I try to access a dataItem["AccountID"] which is invisible gridboundcolumn, it is throwing  "Cannot find a cell bound to column name 'AccountID'"}    System.Exception {Telerik.Web.UI.GridException}  exception.

Any ideas on this???

Is there anyway to give URL's something like this  <a href="cardgroupview.aspx?id=<%# Eval("CardGroupID") %>"><%# Eval("CardGroupName")%></a> at the time of adding GridBoundColumns to radGrid at runtime.


Thanks a lot.

Mahesh
Princy
Top achievements
Rank 2
 answered on 29 Jul 2009
16 answers
236 views
The following are the rules I defined in the ASP Theme CSS file:

body
{
 font-family: Tahoma, Verdana, Arial, serif;
 font-size: 8pt;
 color: #2F4F4F;
 width: 960px;
 margin-left: auto;
 margin-right: auto;
 margin-top: 5px;
}

It makes the web page align in the center. 

I have made a RadMenu on the top and align to the right. 

Problem: When I resize the window, the RadMenu does not move along.  For example, if I make the window smaller, the RadMenu is out of screen.  Only when I hover the mouse over the menu, it shifts to the correct position immediately (align to the right).

It happens to IE7 adn IE7 only. 

Is there any workaround for this?

Thanks
Dirk Eberhardt
Top achievements
Rank 1
 answered on 29 Jul 2009
3 answers
284 views
Hi,
Iam actually binding a radgrid using object datasource.

One of the column(Long Description) has whitespaces in between texts
For example qwe have text like (Sample    Text)..You can see like the text has 3 or 4 white spaces.

While displaying on the ardgrid the browser automatically trimms the spaces and displays (Sample Text).The column text should display as it is..

Is there any property to prevnet the trimming of spaces in the column.


Thanks and Regards
V.Balamurali
Balamurali Venkatesan
Top achievements
Rank 1
 answered on 29 Jul 2009
3 answers
150 views
Ok, this might be a serious problem, if there is not another setting that works with it...
(Don't you hate when people start off posts that way!!! :))

If I set Keyboard navigation to true for a grid.  If I hit the enter key, the row I am on goes into edit mode, whether I allow editing or not.  While I like the keyboard navigation feature, this is not good.

The grid I am using is a display grid only.  I have EnabledPostBackOnRowClick=true. When a user clicks on a row, an ajax request is done updating a seperate area that is used for data editing.  This works fine with mouse navigation, but with keyboard navigation, I assumed hitting enter would act as a mouse click triggering the same functionality.  I was wrong, and this happens even with AllowAutomaticInserts/Deletes/Updates set to false.

Now, since the data in the grid is a query, and cannot tie directly back to the data, an update can't occur, but you can see the problem.

Comments?  (I'm hoping there is just an additional setting I'm missing!)

Thanks, Kuba
Pavel
Telerik team
 answered on 29 Jul 2009
1 answer
365 views
Is there any way to specify the initial position of a pop-up edit form?  The default "upper left hand corner of the grid" doesn't work well with the page layout I'm working on.
Shinu
Top achievements
Rank 2
 answered on 29 Jul 2009
2 answers
192 views
I am developing from the demo you provided here: http://demos.telerik.com/aspnet-ajax/calendar/examples/datepicker/shareddatepicker/defaultcs.aspx?product=grid

In the OnItemCommand event handler I am looping through all the fields that have been changed and save or delete them when the "Update4 All" button is clicked. The problem is when the user clicks the "Add new Record" button. In the UI, the row appears and the user can add new values for each column. But when they click "Update All" this new row is not in the RadGrid1.Items collection. I would like to add this while I am updating and deleting the other rows. Is there a way to do this?

protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e) 
{ 
    if (e.CommandName == "UpdateChanges") 
    { 
        ArrayList editedItems = new ArrayList(); 
        foreach (GridDataItem item in RadGrid1.Items) 
        { 
            if ((item is GridEditableItem) && (item.IsInEditMode)) 
            { 
                Hashtable ht = new Hashtable(); 
 
 
                //add in delete flag 
                ht["ShouldDelete"] = false; 
                if (item.Selected) 
                { 
                    ht["ShouldDelete"] = true; 
                } 
                //add in read only columns 
                ht["ServerID"] = (item.EditManager.GetColumnEditor("ServerID") as GridTextBoxColumnEditor).TextBoxControl.Text; 
 
                if (item.Selected || presenter.ValuesChanged((string)ht["ServerID"])) 
                { 
                    item.ExtractValues(ht); 
 
                    //add in any template columns 
                    ht["OrderDate"] = ((TextBox)(item.EditManager.GetColumnEditor("OrderDate") as GridTemplateColumnEditor).ContainerControl.FindControl("TextBox1")).Text; 
 
                    editedItems.Add(ht); 
                } 
            } 
        } 
 
        if (editedItems.Count > 0) 
        { 
            presenter.UpdateAll(editedItems); 
            XmlDataSource1.Save(); 
            RadGrid1.Rebind(); 
            notificationDisplayMsg.NotificationType = Trizetto.Web.UI.Controls.NotificationType.Information; 
            notificationDisplayMsg.Text = "All changes have been saved."; 
        } 
    } 
} 



Sebastian
Telerik team
 answered on 29 Jul 2009
1 answer
283 views

Hi,

I'm trying to design a master page with a RadMenu to navigate the user to the appropriate url without a full page refresh. All the pages share the same masterpage and need to find a way to have a loading panel display in the ContentPlaceHolder while only the ContentPlaceHolder refreshes.

Here is the code:

MASTER PAGE

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="DefaultTest.master.cs" Inherits="_Default" %>

<%
@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

 

<

 

html>

 

 

<

 

head id="Head1" runat="server">

 

 

 

<title>Default</title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

 

 

 

<link rel="Stylesheet" type="text/css" href="CSS/styleExternal.css" />

 

 </

 

head>

 

 <

 

body>

 

<form runat="server">

 


<
telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnableTheming="True">

 

</telerik:RadScriptManager>

 


<
telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

 

<AjaxSettings>

 

<telerik:AjaxSetting AjaxControlID="ContentArea">

 

<UpdatedControls>

 

<telerik:AjaxUpdatedControl ControlID="ContentArea" LoadingPanelID="RadAjaxLoadingPanel1" />

 

</UpdatedControls>

 

</telerik:AjaxSetting>

 

</AjaxSettings>

 

 

</telerik:RadAjaxManager> 

<
telerik:RadMenu ID="rmMain" runat="server" Skin="Default">

 

 

 

<Items>

 

<telerik:RadMenuItem runat="server" NavigateUrl="~/DefaultTest.aspx" TabIndex="1"  Text="Dashboard">

 

 

</telerik:RadMenuItem>

 

<telerik:RadMenuItem runat="server" NavigateUrl="~/DefaultTest2.aspx" TabIndex="2"  Text="School Information">

 

 

</telerik:RadMenuItem>

 

</Items>

 

</telerik:RadMenu>

<

 

asp:ContentPlaceHolder ID="ContentArea" runat="server">

 

</asp:ContentPlaceHolder>

<

 

telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">

 

 

 

<table style="height: 100%; width: 100%" border="0">

 

 

 

<tr>

 

<td width="100%" align="center" valign="middle">

 

 

<asp:Image ID="Image1" runat="server" ImageUrl="~/Images/Loading/loading.gif"></asp:Image>

 

 

 

</td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</telerik:RadAjaxLoadingPanel>

</
form>

 

</

 

body>

 

</

 

html>

Thanks so much for your help.

Evan

 

 

 

 

 

 

 

 

Arun
Top achievements
Rank 1
 answered on 29 Jul 2009
1 answer
118 views
Hi,

Pls Guide me on how to get the selected Row index from server side.
I have tried the following and did not get the right answer.

protected

 

void SimpleGrid_SelectedIndexChanged(object sender, EventArgs e)

 

{

Response.Write(SimpleGrid.SelectedItems[0].RowIndex);
}

Jidesh

Shinu
Top achievements
Rank 2
 answered on 29 Jul 2009
0 answers
140 views
protected void RadMenu1_ItemClick(object sender, Telerik.Web.UI.RadMenuEventArgs e)  
    {  
        if (e.Item.AccessKey.ToString() == "1")  
        {  
            Control control = LoadControl("home.ascx");  
            control.ID = control.ToString();  
            ContentPlaceHolder1.Controls.Clear();  
            ContentPlaceHolder1.Controls.Add(control);  
        }  
        else 
        {  
            Control control = LoadControl("abt.ascx");  
            control.ID = control.ToString();  
            ContentPlaceHolder1.Controls.Clear();  
            ContentPlaceHolder1.Controls.Add(control);  
        }  
    } 


The above code works fine. And the refresh is eliminated using RadAjaxManager, but for further development process we need do do the above function in client side. I dnt hve an idea whether its is possible, or is there any better method that can be followed to do this in client side.

Thanks in Advance.
Arun.M

Arun
Top achievements
Rank 1
 asked on 29 Jul 2009
1 answer
134 views
I am trying to remove all nodes in server side but it is not working. Anyone have a sample code?

My code is like this

foreach

 

(RadTreeNode node in mytreeView.GetAllNodes())

 

{

    node.Remove();

}


Thanks




Shinu
Top achievements
Rank 2
 answered on 29 Jul 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?