Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
184 views
Is there a way to trigger a radgrid rebind from datasource update?
Basically I have a column to display info once the backend operation is done.
Princy
Top achievements
Rank 2
 answered on 06 Dec 2013
7 answers
437 views
I am using  EditMode="InPlace" and  AllowMultiRowEdit="True" to edit a RadGrid.  I am also using a non RadGrid button to save the RadGrid to a database.  Column1 in the RadGrid is read only.  I am using ExtractValuesFromItem(newValues, editedItem) to get the cell that was changed.  This works, but I don't know how to reference the value in the read only cell in column1 to see which row was edited.  I need this to update the database based on the read only information in Column1.  I will also be adding databound dropdown lists in the EditItem template so a solution that drastically changes the code below also needs to be able to handle that.  
 
protected void SaveButton_Click(object sender, EventArgs e)
   {
       foreach (GridItem item in RadGrid1.Items)
       {
           if (item.IsInEditMode)
           {
               GridEditableItem editedItem = (GridEditableItem)item;
               Hashtable newValues = new Hashtable();
               editedItem.OwnerTableView.ExtractValuesFromItem(newValues, editedItem);
 
               // I need to get the value in Column1 on the edited row. 
               string ReadOnlyCell = ["Column1"].toString();
 
               string ChangedCell = newValues["Column2"].ToString();
               // will update SQL here...
               editedItem.Edit = false;
           }
       }
       RadGrid1.Rebind();
   }

 

 

 

Asad
Top achievements
Rank 1
 answered on 06 Dec 2013
5 answers
136 views
Hi All:

We have a rather large project where we are using RadGrid from Telerik 2011.1.519.35.  We are having a problem with IE10 where the RadGrid will only resolve / appear to about half it's width (i.e., we have one-half of the grid appearing).  IE10 then locks up.

We are not having this problem with any other browser (including earlier versions of IE).  Unfortunately, while we use Chrome for internal users of our system, we cannot control what browser is used by external users.

We make heavy use of Telerik controls in our application and updating to a more recent version will require a large amount of recursion testing before we could roll out a new version of the dlls.

Is there any workaround to this, or is our only recourse to update to the latest version of Telerik?

Thanks for your help in this matter.

Venelin
Telerik team
 answered on 06 Dec 2013
1 answer
143 views
Good Afternoon,

I had the idea of including a RadGrid control inside a custom server control ( reusable on various sites ) and everything works just peachy apart the .Click event of a LinkButton in a TemplateColumn that I can't seem to intercept !

The layout is as follows:

aspx
  asp:Panel
    MyControl
      telerik:RadGrid
        MasterTableView
          GridTemplateColumn
            LinkButton

The LinkButton is created on fly during the RadGrid.ItemDataBound event and added to the columns control collection via:


Dim o_LineDeleteItem As New LinkButton With {.Text = "Del", .ID = String.Format("Delete|" & __Item.DataItem("slc_ID").ToString), .CommandName = "DeleteLineItem", .CommandArgument = __Item.DataItem("slc_ID").ToString}
__Item("Options").Controls.Add(o_LineDeleteItem)

 
I have tried with/without AddHandler and whatnot, can't seem to get it to work.

The Panel is ajaxified via a RadAjaxManagerProxy and has a RadAjaxLoadingPanel that correctly shows when I click the LinkButton in the grid ... but for some reason I am unable to either get the RadGrid.ItemCommand or LinkButton.Click event to fire to actually do something when the button was clicked.

I tried if many different ways, but this being my first such implementation I most certainly miss something ( more or less ) important.

Any clues on this ?

PS: I looked thru the documentation and searched the www ... to no avail.
Shinu
Top achievements
Rank 2
 answered on 06 Dec 2013
0 answers
112 views
Hi
i am having treeview which shows parent node as company name and child node as employee name
there may be 2 conditions possible
1 ] IF logged in user is COMPANY ADMIN then the parent node=Company name and Child Nodes are employees from that company 

and image is also given
2 ] IF logged in user is SUPER USER then he can view all company as parent names and the employees in that company name
image is given and also code
private void BindToDataTable(RadTreeView RadTreeView1)
   {
       RadTreeView1.DataSource = "";
       RadTreeView1.DataBind();
        
       int UserId = Convert.ToInt32(Session["UserId"].ToString());
       int RoleId = Convert.ToInt32(Session["RoleId"].ToString());
       Temp = objGlobas.BindTreeView_Test(UserId, RoleId);
 
       //Get Permission to logged in user individually and by group and combine these Entities into one datatable dt2
 
       Globas ObjGlobas = new Globas();
       DataTable dtViewPermission = new DataTable();
       dtViewPermission = ObjGlobas.ViewPermission(UserId);
 
       DataTable RootNode = new DataTable();
       RootNode = Temp;
       DataView dView = new DataView(RootNode);
       string[] arrColumns = { "CompName", "CompId" };
       RootNode = dView.ToTable(true, arrColumns);
       if (Convert.ToInt32(Session["RoleId"]) == 1)
       {
           DataTable dtchildnode = new DataTable();
            
           if (Temp.Rows.Count > 0 && Temp != null)
           {
               foreach (DataRow row in RootNode.Rows)
               {
                   RadTreeNode tnparent = null;
                   string ParentNode = row["CompName"].ToString().Trim();
                   string ParentID = row["CompId"].ToString().Trim();
                   tnparent = new RadTreeNode(ParentNode);
                   tnparent.Value = ParentID.ToString();
                   RadTreeView1.Nodes.Add(tnparent);
                   tnparent.AllowEdit = false;
                   tnparent.ContextMenuID = "contextMenu1";
 
                   int CompanyId = Convert.ToInt32(ParentID);
                   dtchildnode = ObjGlobas.BindTreeView_SuperUser(CompanyId);
                   foreach (DataRow dr in dtchildnode.Rows)
                   {
                       RadTreeNode Child = null;
                       string child = dr["EntityName"].ToString();
                       string EntityId = dr["EntityId"].ToString();
                       Child = new RadTreeNode(child);
                       Child.Value = EntityId;
                       tnparent.Nodes.Add(Child);
                       Child.ContextMenuID = "contextMenu2";
                   }
               }
           }
       }
       else
       {
           if (Temp.Rows.Count > 0 && Temp != null)
           {
               foreach (DataRow row in RootNode.Rows)
               {
                   RadTreeNode tnparent = null;
                   string ParentNode = row["CompName"].ToString().Trim();
                   string ParentID = row["CompId"].ToString().Trim();
                   tnparent = new RadTreeNode(ParentNode);
                   tnparent.Value = ParentID.ToString();
 
                   RadTreeView1.Nodes.Add(tnparent);
                   tnparent.AllowEdit = false;
                   tnparent.ContextMenuID = "contextMenu1";
 
 
                   foreach (DataRow dr in dtViewPermission.Rows)
                   {
                       RadTreeNode Child = null;
 
                       string child = dr["EntityName"].ToString();
                       string EntityId = dr["EntityId"].ToString();
                       Child = new RadTreeNode(child);
                       Child.Value = EntityId;
                       tnparent.Nodes.Add(Child);
                       Child.ContextMenuID = "contextMenu2";
                   }
               }
           }
       }
      
        
   }


my problem is while SUPER USER login for each companys child node stored procedure is executing,is there any alternative way to do this.
Thanks
Swapnil
Top achievements
Rank 1
 asked on 06 Dec 2013
1 answer
92 views
Hello,
 
I am displaying a RadWindow in modal form. Window displays fine but if I move window around and try to move it over a menu, then the menu is shown on the top, window gets below. Plus if I keep moving it then it goes under the address bar of the browser. After that there is no way to drag window back. See the screen shot attached .... Any suggestions?

Thanks in advance!
Princy
Top achievements
Rank 2
 answered on 06 Dec 2013
4 answers
174 views
Only first row RadButton in RadGrid can fire, please help.
Thanks

In Grid:
<telerik:GridTemplateColumn HeaderStyle-Width="20%" UniqueName="ButtonSet">
    <ItemTemplate>
        <telerik:RadButton runat="server" id="Button1" CommandName="Action1" AutoPostBack="true" CausesValidation="false" OnClientClicked="clientclick"></telerik:RadButton>
        <telerik:RadButton runat="server" id="Button2" CommandName="Action2" AutoPostBack="true"></telerik:RadButton>
    </ItemTemplate>
</telerik:GridTemplateColumn>

In RadAjaxManager:
<telerik:AjaxSetting AjaxControlID="Button1
"
>
    <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="label" LoadingPanelID="RadAjaxLoadingPanel1" />
    </UpdatedControls>
</telerik:AjaxSetting>

if (e.CommandName == "Action1")
{
    //do sth
}
else if (e.CommandName == "Action1")
{
    //do sth
}










Roland
Top achievements
Rank 1
 answered on 06 Dec 2013
1 answer
271 views

Hi There

I have master/content page with two ContentPlaceHolders: Nav and Main. both Nav and Main contain UserControls, where Nav has a navigation UserControl (RadPanel with RadTreeView) and Main has a RadGrid (kind of obvious, right ;-) ).

Obviously the objective is to populate the RadGrid with data dependent on the node that is clicked.

Instead of bubbling up events from the user controls, which I find awkward, I thought I could put the NodeClick Event Handler in the code behind on the content page and assign the event handler in the page load event:



protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ContentPlaceHolder cph = (ContentPlaceHolder)this.Master.FindControl("ContentPlaceHolderNav");
            RadPanelBar rpb = (RadPanelBar)cph.FindControl("RadPanelBar1");
            RadPanelItem itm = (RadPanelItem)rpb.Items[1];
            UserControl uc = (UserControl)itm.FindControl("Nav");
            RadTreeView rtv = (RadTreeView)uc.FindControl("RadTreeView2");
            rtv.NodeClick += RadTreeView1_NodeClick;
        }
    }


The code works - when stepping through I can see that the TreeView is found - but the event doesn't fire when clicking on a node (-> a breakpoint in RadTreeView1_NodeClick in the content page is not reached).

Is what I'm trying to do not possible? Or does this just need to go somewhere else in the page lifecycle (Page_Init?).

Thx in advance for help and/or pointers!

Rgds - Marcus.

Shinu
Top achievements
Rank 2
 answered on 06 Dec 2013
1 answer
182 views
Hi,


     I have anchor tag in my masterpage.I want to find that control.

     And want to trigger confirm alert  in onclick of that control.


Thanking you,

P.Mugil


 
Princy
Top achievements
Rank 2
 answered on 06 Dec 2013
1 answer
111 views
I have RadNumericTextBox and asp:DropDownList. How can I implement the following:
If RadNumericTextBox.value empty or 0 set asp:DropDownList enable=true
else asp:DropDownList enable=false without postback?

Shinu
Top achievements
Rank 2
 answered on 06 Dec 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?