Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
199 views
I am dynamically creating radbuttons on a webpage, but cannot get them to post back to the server. 

Any ideas would be greatly appreciated!

Here is the code, this is within a loop creating the items:
aComboBox(aTextBoxCount) = New TextBox
aComboBox(aTextBoxCount).TextMode = TextBoxMode.MultiLine
aComboBox(aTextBoxCount).ReadOnly = True
aEditButton(aTextBoxCount) = New RadButton
aEditButton(aTextBoxCount).Text = "Edit"
aEditButton(aTextBoxCount).ID = aTextBoxCount
aEditButton(aTextBoxCount).AutoPostBack = True
AddHandler aEditButton(aTextBoxCount).Click, AddressOf EditText
 
 
aComboBox(aTextBoxCount).ID = "aComboBox" & aTextBoxCount
aComboBox(aTextBoxCount).Width = TextBoxWidth
aComboBox(aTextBoxCount).DataBind()
aComboBox(aTextBoxCount).Text = ""
 
RadMultiPage1.PageViews(cCheckBoxTab).Controls.Add(New LiteralControl("<table><tr><td style=""width: 45px""></td><td>"))
RadMultiPage1.PageViews(cCheckBoxTab).Controls.Add(aComboBox(aTextBoxCount))
RadMultiPage1.PageViews(cCheckBoxTab).Controls.Add(New LiteralControl("</td><td>"))
RadMultiPage1.PageViews(cCheckBoxTab).Controls.Add(aEditButton(aTextBoxCount))
RadMultiPage1.PageViews(cCheckBoxTab).Controls.Add(New LiteralControl("</td></tr></table>"))

Shinu
Top achievements
Rank 2
 answered on 21 Nov 2013
1 answer
112 views
I have several RadDocks added to an ASP PlaceHolder in a ASP page, before the page init. After the page is loaded, I don't see the rounded corners which I enabled. The appearance of the commands don't change when I hover over them. The collapse animation seems to work, but there is no expand animation. 

The problem only arises in IE9. Within Firefox the rounded corners are displayed, etc. 
With a simpler project in IE9 - just an ASP page with a RadDock with the same settings set - the rounded corners are displayed as well. 

My assumption of the cause was HTML syntax errors in the page, however those are fixed now and the issue still appears.
Does it sound familiar? Thanks in advance. 
Slav
Telerik team
 answered on 21 Nov 2013
3 answers
146 views
Hi, we have a .net user control that works very well as an edit form within the grid, with one exception. We have an Insert button, an Update button and finally a Cancel button, with CommandNames set to Insert, Update, and Cancel respectively. Depending on whether a primary key value exists from the database, we either hide the insert button or show it. 

If we are updating, the form performs as expected and the edit form disappears and the grid updates with the new values.

But inserts fail to make the edit form disappear. If we click cancel, the edit form disappears and we see the newly inserted value in the grid. 

We were under the assumption that setting the Command Name to Insert would be what we need, but apparently this is not the case. Does anyone have any ideas on either, a) what we are doing wrong or b) a way to force the edit form to close... from within the edit form control as that is where the post back and processing takes place. Many thanks.
Viktor Tachev
Telerik team
 answered on 21 Nov 2013
4 answers
180 views
I would like to pass a parameter to the webservice that would populate my dropdown.  It doesn't appear that this is currently possible?

Specifically I want to limit the values of one dropdown from the selection made in another dropdown.
Rumen
Telerik team
 answered on 21 Nov 2013
1 answer
117 views
hi,

In  my rad gird i am using radbutton with button type as "ToggleButton" to fill the all the text boxes based on one calculation. it is working fine for functionality. But the problem is when ever the grid is in edit mode. the table layout is fixed and looks good. but When i click the radButton the grid design is not stable though it worked fine for functionality.  
Here i attached the screen shots before the button click and after the button click. Also the desing code.

Thank You.
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" OnItemDataBound="RadGrid1_ItemDataBound" OnItemCreated="RadGrid1_ItemCreated"
        AllowSorting="True" AllowMultiRowSelection="False" OnItemCommand="RadGrid1_ItemCommand" AutoGenerateEditColumn="false" OnDataBound="RadGrid1_DataBound"
        OnDetailTableDataBind="RadGrid1_DetailTableDataBind" OnNeedDataSource="RadGrid1_NeedDataSource" OnInsertCommand="RadGrid1_InsertCommand"
        OnPreRender="RadGrid1_PreRender">
 
        <MasterTableView DataKeyNames="TempAccountsId" ShowFooter="true" TableLayout="Auto" AllowMultiColumnSorting="True" EditMode="InPlace">
            <DetailTables>
                <telerik:GridTableView DataKeyNames="CleaningId" CommandItemDisplay="Top" TableLayout="Fixed" Name="Cleaning" ShowFooter="true" EditMode="InPlace" AllowAutomaticUpdates="false">
                    <Columns>
                        <telerik:GridTemplateColumn Visible="false">
                            <ItemTemplate>
                                <asp:Label ID="lblCleaningId" runat="server" Text='<%#Eval("CleaningId") %>'></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderText="Edit" UniqueName="Edit" HeaderStyle-Width="70px" ItemStyle-Width="70px" HeaderStyle-HorizontalAlign="Center"
                            EditImageUrl="../Images/edit.gif" ItemStyle-HorizontalAlign="Center"  >
                        </telerik:GridEditCommandColumn>
                        <telerik:GridTemplateColumn HeaderText="Delete" UniqueName="Delete" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="45px" ItemStyle-Width="45px" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:ImageButton runat="server" ID="imgdelete" OnClientClick="return confirm('Are you sure that you want to Delete?');"
                                    ImageUrl="../Images/delete.gif" CommandName="Delete" CommandArgument="" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Description" UniqueName="Description" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="170px" ItemStyle-Width="160px">
                            <ItemTemplate>
                                <asp:Label ID="lblExplanation" runat="server" Text='<%#Eval("Description") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtDescriptionEdit" runat="server" Text='<%#Eval("Description") %>' Width="155px"
                                    MaxLength="180"></asp:TextBox>
                            </EditItemTemplate>
                            <InsertItemTemplate>
                                <asp:TextBox ID="txtDescriptionInsert" runat="server" Width="155px"
                                    MaxLength="180" BorderWidth="1px"></asp:TextBox>
                            </InsertItemTemplate>
                            <FooterTemplate>
                                <asp:Label ID="lblSubtotalFooter" runat="server" Text="Sub Total"></asp:Label>
                            </FooterTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn>
                            <ItemTemplate>
                                <asp:Label ID="lblNotes" runat="server" Text='<%#Eval("Notes") %>' Visible="false"></asp:Label>
                                <asp:ImageButton ID="imgNotes" runat="server" ImageUrl="~/Images/TextboxHS.png" CommandArgument='<%#Eval("CleaningId") %>'
                                    CommandName="OpenWindowView" Visible="false" />
                            </ItemTemplate>
                            <HeaderStyle Width="30px" />
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Notes" UniqueName="Notes">
                            <ItemTemplate>
                                <asp:ImageButton ID="imgNotesEdit" ImageUrl="~/Images/edit.gif" runat="server"
                                    CommandName="OpenWindow" CommandArgument='<%#Eval("CleaningId") %>' />
                            </ItemTemplate>
                            <HeaderStyle Width="40px" />
                        </telerik:GridTemplateColumn>
 
                        <telerik:GridTemplateColumn HeaderStyle-Width="220px" UniqueName="Rate" HeaderText="Rate" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="210px"
                            HeaderStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:RadioButton ID="rdbtnPerSqft" runat="server" Text="PerSqft" GroupName="Rate" Enabled="false" Checked='<%# bool.Parse(Eval("IsPerSqftRate").ToString()) %>' />
                                <asp:RadioButton ID="rdbtnFlat" runat="server" Text="Flat" GroupName="Rate" Enabled="false" Checked='<%# bool.Parse(Eval("IsFlatRate").ToString()) %>' />
                                <asp:Label ID="lblPerSqFtRatedisplay" runat="server" Width="50px" Style="text-align: right;" Text='<%# string.Format("{0:n}", Convert.ToDecimal(Eval("PerSqFtRate"))) %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadButton ToggleType="Radio" ID="rdbtnPerSqftEdit" Width="40px" ButtonType="ToggleButton" CommandName="PerSqftRate" Text="PerSqft" runat="server" GroupName="Rate" Checked='<%# bool.Parse(Eval("IsPerSqftRate").ToString()) %>'>
                                </telerik:RadButton>
                                <telerik:RadButton ToggleType="Radio" ID="rdbtnFlatEdit" Width="20px" ButtonType="ToggleButton" CommandName="Flatrate" Text="Flat" runat="server" GroupName="Rate" Checked='<%# bool.Parse(Eval("IsFlatRate").ToString()) %>'>
                                </telerik:RadButton>
                                <asp:TextBox ID="txtRateEdit" runat="server" Width="80px" CssClass="AlgRgh" Visible="true" Text='<%# string.Format("{0:n}", Convert.ToDecimal(Eval("PerSqFtRate"))) %>'
                                    onkeypress="javascript:return Allownumbersonly(event);" BorderWidth="1px"></asp:TextBox>
                                <asp:Label ID="lblRateEdit" runat="server" Visible="false" Text='<%# string.Format("{0:n}", Convert.ToDecimal(Eval("PerSqFtRate"))) %>'></asp:Label>
                            </EditItemTemplate>
                            <InsertItemTemplate>
                                <telerik:RadButton ToggleType="Radio" ID="rdbtnPerSqftinsert" Width="40px" ButtonType="ToggleButton" CommandName="PerSqftinsert" Text="PerSqft" runat="server" GroupName="Rate">
                                </telerik:RadButton>
                                <telerik:RadButton ToggleType="Radio" ID="rdbtnFlatinsert" Width="20px" ButtonType="ToggleButton" CommandName="Flatrateinsert" Text="Flat" runat="server" GroupName="Rate">
                                </telerik:RadButton>
                                <asp:TextBox ID="txtRateinsert" runat="server" Width="80px"
                                    onkeypress="javascript:return Allownumbersonly(event);" BorderWidth="1px"></asp:TextBox>
                            </InsertItemTemplate>
                        </telerik:GridTemplateColumn>
 
                        
                    </Columns>
                </telerik:GridTableView>
            </DetailTables>
            <Columns>
                <telerik:GridTemplateColumn HeaderText="AccountId" UniqueName="TempAccountsId" Visible="false">
                    <ItemTemplate>
                        <asp:Label ID="lblTempAccountsId" runat="server" Text='<%#Eval("TempAccountsId") %>'></asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn HeaderText="Account Number" UniqueName="AccountNumber" ItemStyle-Width="120px" HeaderStyle-Width="120px" HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left">
                    <ItemTemplate>
                        <asp:Label ID="lblAccountNumber" runat="server" Text='<%#Eval("AccountNumber") %>'></asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn HeaderText="Account Name" UniqueName="AccountName" ItemStyle-Width="210px" HeaderStyle-Width="220px" HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left">
                    <ItemTemplate>
                        <asp:Label ID="lblAccountName" runat="server" Text='<%#Eval("AccountName") %>'></asp:Label>
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:Label ID="lbltotalFooter" runat="server" Text="Total:"></asp:Label>
                    </FooterTemplate>
                </telerik:GridTemplateColumn>
                
 
            </Columns>
        </MasterTableView>
        <ClientSettings AllowKeyboardNavigation="true" EnableRowHoverStyle="true">
        </ClientSettings>
    </telerik:RadGrid>
Venelin
Telerik team
 answered on 21 Nov 2013
1 answer
151 views
I am getting the error (Object Reference not set to an instance of an Object) on adding the Telerik SPradgridview webpart into my site i have already given anonymous accesss for the vti_bin\telerik.ajax.sharepoint folders,

Note :  SPradlistview webpart is working fine on adding into my site


looking for a resolution from telerik team
Marin
Telerik team
 answered on 21 Nov 2013
1 answer
83 views
When I open a new project in vs 2012 "new empty template asp" and I add radcombobox everything is fine and very little viewstate. But if I open a new project vs 2012 "new website" - No empty templat!!! and I add  radcombobox the viewstate
 very long and unusual something wrong. Why???
Nencho
Telerik team
 answered on 21 Nov 2013
5 answers
211 views
Hi,

Can you point me in the right direction on how to add a new blank row to radgrid on the client using javascript?
Here's what i have so far. Onclient button click I call a web service to insert a blank row into database,
then on success of the web service call I rebind the grid on client. Here is the code: There's also a screen shot to give you a better idea.
  function updateChanges() {
             ItemsService.AddNewItem(updateGrid());   
         }
         function updateGrid(result) {
            var masterTable = $find("<%= grdInvoiceItems.ClientID %>").get_masterTableView();
            masterTable.fireCommand("RebindGrid");
 
//             $find("<%= grdInvoiceItems.ClientID %>").get_masterTableView().rebind();
         }

Thanks,
Ron
Angel Petrov
Telerik team
 answered on 21 Nov 2013
1 answer
96 views
Hi guys,
I have a following code in my aspx page:
<telerik:RadComboBox ID="RadComboBoxStatusGrp" runat="server" Width="125px"
             Height="150px" Font-Size="Small" CssClass="txtinput" AutoPostBack="false"
             EmptyMessage="Choose a Status" ShowToggleImage="true"
              OnClientDropDownOpened="OnClientDropDownOpenedHandler">

             
      <ItemTemplate>
       <div id="div1">
       <telerik:RadTreeView runat="server" ID="RadTreeView1" OnClientNodeClicking="nodeClicking">
        <Nodes>
          <telerik:RadTreeNode runat="server" Text="All Trans" Expanded="true" >
           <Nodes>
            <telerik:RadTreeNode runat="server" Text="Approved"  >
            </telerik:RadTreeNode>
             <telerik:RadTreeNode runat="server" Text="Entered"  >
             </telerik:RadTreeNode>
                         
            </Nodes>
            </telerik:RadTreeNode>
            </Nodes>  
            <Nodes>
             <telerik:RadTreeNode runat="server" Text="Processed" ></telerik:RadTreeNode>
            </Nodes>
            <Nodes>
             <telerik:RadTreeNode runat="server" Text="All" ></telerik:RadTreeNode>
            </Nodes>  
       </telerik:RadTreeView>
       </div>
      </ItemTemplate>
      <Items>
        <telerik:RadComboBoxItem Text="" />
      </Items>
     </telerik:RadComboBox>
      <script type="text/javascript">
          var div1 = document.getElementById("div1");
          div1.onclick = StopPropagation;
            </script>
When I ran first time my application I choose node("Approved") and click on it and this node appear in the combobox, I click search button and everything is working fine but next time  I want to choose the other node("Entered") and when I click once but this node  not showing in combobox I need to click it again to get this node show in combobox.

Please help me,
Thanks
Shinu
Top achievements
Rank 2
 answered on 21 Nov 2013
1 answer
75 views
Hello,

I have multiple radgrids on a page and i'm trying to freeze left 2 columns for each.
But it works only for the first grid on the page.
Sample code is given below:
First two grids have same number of rows. Second row would have two grids similar to first row but would have less rows.
Can you please help with a sample code?
<table>
<tr>
                    <td style="width: 590px">
                        <asp:Panel ID="panelRateReport" ScrollBars="Horizontal" Width="99.8%" runat="server"
                            Height="410">
                            <telerik:RadGrid runat="server" ID="gridRate" AutoGenerateColumns="true" Height="99%"
                                Skin="Hay" GridLines="Both" OnPreRender="gridRate_PreRender" OnColumnCreated="gridRate_ColumnCreated"
                                OnItemDataBound="gridRate_ItemDataBound">
                            </telerik:RadGrid>
                        </asp:Panel>
                    </td>
                    <td style="width: 20px">
                    </td>
                    <td>
                        <asp:Panel ID="panel1" runat="server" ScrollBars="Horizontal" Width="99.8%" Height="410">
                            <telerik:RadGrid runat="server" ID="gridRateAbove10k" AutoGenerateColumns="true"
                                Height="99%" GridLines="Both" Skin="Hay" OnPreRender="gridRate_PreRender"
                                OnColumnCreated="gridRate_ColumnCreated" OnItemDataBound="gridRate_ItemDataBound">
                            </telerik:RadGrid>
                        </asp:Panel>
                    </td>
                </tr>
<tr>
....
</tr>
<table>
Princy
Top achievements
Rank 2
 answered on 21 Nov 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?