
I have a grid with two buttons on each row, open and remove. Using OnItemCommand click the button goes to the code fine, the remove button works fine but the open button always gets the id from the first row.
This is the code that creates the two buttons, the same except for the names and images.
GridButtonColumn gridButtonColumn = new GridButtonColumn(); gridButtonColumn.ButtonType = GridButtonColumnType.ImageButton; gridButtonColumn.ImageUrl = "~/Images/OpenLinkIcon.png"; gridButtonColumn.CommandName = "OpenLink"; gridButtonColumn.UniqueName = "OpenLink"; gridButtonColumn.Text = "Open Signup Template"; gridButtonColumn.Display = true; gridButtonColumn.HeaderText = ""; gridButtonColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center; gridButtonColumn.HeaderStyle.Width = Unit.Pixel(40); signupGrid.MasterTableView.Columns.Add(gridButtonColumn);
gridButtonColumn = new GridButtonColumn(); gridButtonColumn.ButtonType = GridButtonColumnType.ImageButton; gridButtonColumn.ImageUrl = "~/Images/DeleteIcon.png"; gridButtonColumn.CommandName = "Delete"; gridButtonColumn.UniqueName = "Delete"; gridButtonColumn.Text = "Remove Signup Template"; gridButtonColumn.Display = true; gridButtonColumn.HeaderText = ""; gridButtonColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center; gridButtonColumn.HeaderStyle.Width = Unit.Pixel(40); signupGrid.MasterTableView.Columns.Add(gridButtonColumn);
This is the grid definition
<div id="GridDiv" runat="server" > <asp:panel runat="server" ID="Panel1" CssClass="windowPercent" > <telerik:RadGrid runat="server" ID="SignupGrid" OnItemCommand="Grid_ItemCommand"></telerik:RadGrid> </asp:panel></div>
And this the aspx.cs code for the Grid_ItemCommand.
protected void Grid_ItemCommand(object source, GridCommandEventArgs e) { if (isPageRefresh || e == null || e.Item == null) { return; } GridDataItem item = (GridDataItem)e.Item; string strId = item[SignupListData.FIELD_ID].Text; switch (e.CommandName) { case "Delete": string name = item[SignupListData.FIELD_NAME].Text; lblConfirm.Text = "Are you sure you want to remove sigup template \"" + name + "\"?"; RemoveSignup.Value = "Yes"; RemoveId.Value = strId; break; case "OpenLink": this.Response.Redirect("/Signup/Design/" + strId); break; } }
The and name values for Delete is the proper one for the row, while the for OpenLink is always the FIELD_ID from the first row,
Searching the forums and examples I found several different ways of getting the field id value but none of them worked.
No idea how to fix this problem.
George
FYI: the form to post this to the forum has a buggy edit box. If I backspace once its works but further ones will skip to the front of words removing spaces unexpectedly. It was rather difficult to make this post.
Hi,
Would it be possible to resize the RadWindow proportional only when manually resizing?
So, like when holding Shift key in PhotoShop.
Marc

Here is the idea: a tree view with nodes. Once a node is clicked, the server generates a panel with some buttons specific for that node. Those buttons once clicked (Click event postback) call the event handler on the server. Basically dynamically created nodes with postbacks after being clicked create buttons with postbacks.
Here is my approach: I have a RadTreeView with some data. The RadTreeView has a "OnNodeClick" event handler that gets the actual clicked node. Then the server generates dynamically buttons on a panel based on the value in the node. Problem is that the "OnNodeClick" event handler is fired after the page load and therefore the postbacks from the buttons are not bound. So I tried another approach by adding the selected node value to the ViewState and then reading from it at Page_Load, but the problem is still the same. The chain is Page_Load -> OnNodeClicked, so the ViewState gets set only after the controls have been generated and therefore only on a second Page_Load I can actually get the value.
Some code to make it clear:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
InitTreeNodesFromServices(resourceTree);
}
var resourceIdObj = ViewState["ResourceId"];
if(resourceIdObj != null)
GenerateButtonsForSelection((string)resourceIdObj);
}
protected void resourceTree_OnNodeClick(object sender, RadTreeNodeEventArgs e)
{
ViewState.Add("ResourceId", e.Node.Value);
}
I know it's a simple issue, but I have been stuck with it for a whole day at this point. What is the right way to handle this situation? Maybe I need a different approach? Thank you.


I'm trying to implement two panels that slide and dock similar to visual studio's Solution Explorer and Properites. I was able to make them slide using splitter/slidingzone/slidingpane with a litlle tab appearing when they are hidden. I want to also be able to dock them side by side by dragging one of them next to the other one. For my search I found that it may be done using Dock but I did not find how to do it. I tried to implement it by it did not work with me and I had to revert back to the splitter code to implement other functionalities. what it did was putting the slidingzone inside the dock/dockzone/dockpane
<telerik:RadSplitter RenderMode="Lightweight" ID="RadSplitter1" Skin="Material" runat="server" Width="100%" Height="100%"> <telerik:RadPane ID="LeftPane" runat="server" Width="22px" Scrolling="none" Locked="False"> <telerik:RadSlidingZone ID="SlidingZone1" runat="server" Width="22px" RenderMode="Lightweight"> <telerik:RadSlidingPane ID="RadSlidingPane1" Title="Emergency" runat="server" Width="300px" MinWidth="300"> <uc1:EmergencyControl runat="server" ID="EmergencyControl" /> </telerik:RadSlidingPane> <telerik:RadSlidingPane ID="Radslidingpane2" Title="Alarm" runat="server" Width="300px" MinWidth="300"> <uc1:AlarmControl runat="server" ID="AlarmControl" /> </telerik:RadSlidingPane> </telerik:RadSlidingZone> </telerik:RadPane> <telerik:RadPane ID="MiddlePane1" runat="server" Scrolling="None"> <telerik:RadSplitter RenderMode="Lightweight" ID="Radsplitter2" runat="server" Orientation="Horizontal" VisibleDuringInit="false" Height="100%"> <telerik:RadPane ID="MapPane" runat="server"> <uc1:MapControl runat="server" ID="MapControl" Height="100%" /> </telerik:RadPane> </telerik:RadSplitter> </telerik:RadPane> <telerik:RadPane ID="EndPane" runat="server" Width="22px" Scrolling="None"> <telerik:RadSlidingZone ID="Radslidingzone1" runat="server" Width="22px" ClickToOpen="true" SlideDirection="Left"> <telerik:RadSlidingPane ID="AlarmBtnPane" Title="Alarm Button" runat="server" Width="50px" MinWidth="50" EnableDock="False" EnableResize="False" TabView="TextAndImage"> <uc1:AlarmBtnControl runat="server" ID="AlarmBtnControl" /> </telerik:RadSlidingPane> </telerik:RadSlidingZone> </telerik:RadPane></telerik:RadSplitter>
So I you can provide a example on how to implement it.

Hi, I am using this kb article to display a RadConfirm when the user clicks on a Delete button. I am currently using the latest build.
Everything worked fine, but lately it doesn't postback anymore ONLY ON FireFox.
I tried to replicate the issue in a small project, but it works as expected, so I guess there should be something I do in other places that breaks the behavior of the toolbar (?).
Note that
- if I remove the RadConfirm (or simply I do not cancel the ButtonClicking event) it works, so all my other code runs without interfering with the postback
- if I try to force a postback by calling __doPostBack() (after clicking on the Delete button and answering the RadConfirm) it doesnt work too
- I have a version of the application that runs with Telerik version 2015.2.623 without any problem (I am now going to try to go back to this version and see if it solves anything)
I need a way I can debug this, as what happens after I click Yes on the RadConfirm is a mix of Telerik and MS code that is fairly complex.
Thanks in advance
Luca