Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
239 views
Hello,
        When i am using <telerik:GridButtonColumn ButtonType="ImageButton" Text="Select" CommandName="select" ImageUrl="~/App_Themes/WebBlue/Grid/images/Hand.png" CommandArgument="Select" >
in gridview instead of button then gridview command event not fired
        So describe why this event not fired when used Imagebutton instead of PushButton and how to overcome this problem.
        Reply me as soon  as possible


Regards,
Bhavesh Rana
Princy
Top achievements
Rank 2
 answered on 17 Mar 2014
1 answer
201 views
Hello,

I can't seem to use a custom Save button work. Can someone point me to where I'm going wrong.

Thanks
Thomas

protected void btnSave_Click(object sender, EventArgs e)
{
Button btn = (Button)sender;

foreach (GridEditableItem item in radNotifications.EditItems)
{
string ss = item["PersonalNote"].Text;
Business.PushNotifications.SaveNote((int)Session["CompanyId"], ss, new Guid(btn.CommandArgument.ToString()));
break;
}

radNotifications.EditIndexes.Clear();
BindGrid();
}
Princy
Top achievements
Rank 2
 answered on 17 Mar 2014
4 answers
227 views
Hi

I am using griddropdowncolumn to display/edit & inserting records in a Telerik grid.

Everything works fine but I also want to use the griddropdowncolumn as a combobox also. I have changed the property
of DropDownControlType="RadComboBox" but till then I am unable to accept text in the combo box.

My intention is use the griddropdowncolumn as a combo box so that the users can do the following at the time of Insert / Edit

1) Can choose the value form the dropdown OR 2) If the value is not available in the dropdown he can type the same so that I can save
it to database.

Given bellow is by ASPX File: (Please have a look in the code with Bold Formatting)

<asp:SqlDataSource ID="SqlDtLedger" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConStr %>" 
        SelectCommand="Select * from Master_Accounting_Sub_Ledger where [Is_Visiable] ='Y'"  
        UpdateCommand="UPDATE Master_Accounting_Sub_Ledger SET [Ledger_ID] = @Ledger_ID, Sub_Ledger_Name = @Sub_Ledger_Name WHERE Sub_Ledger_ID = @Original_Sub_Ledger_ID"
        InsertCommand="INSERT INTO [Master_Accounting_Sub_Ledger] ([Ledger_ID],[Sub_Ledger_Name],[Entry_Type]) VALUES ( @Ledger_ID, @Sub_Ledger_Name, 'C')"
        DeleteCommand="UPDATE Master_Accounting_Sub_Ledger SET [Is_Visiable] ='N' WHERE Sub_Ledger_ID = @Original_Sub_Ledger_ID and Entry_Type <>'S'"
        OldValuesParameterFormatString="original_{0}" ConflictDetection="CompareAllValues">
        <UpdateParameters>
            <asp:Parameter Name="Original_Sub_Ledger_ID" Type="Int32" />
            <asp:Parameter Name="Ledger_ID" Type="Int32" />
            <asp:Parameter Name="Sub_Ledger_Name" Type="String" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="Ledger_ID" Type="Int32" />
            <asp:Parameter Name="Sub_Ledger_Name" Type="String" />
        </InsertParameters>
        <DeleteParameters>
            <asp:Parameter Name="Original_Sub_Ledger_ID" Type="Int32" />
        </DeleteParameters>
     </asp:SqlDataSource>

    <asp:SqlDataSource ID="Data_Accounting_Ledger_Name" runat="server"
     ConnectionString="<%$ ConnectionStrings:ConStr %>" 
        SelectCommand="Select * from Master_Accounting_Ledger WHERE Sub_Ledger=1" >
    </asp:SqlDataSource>

     <asp:SqlDataSource ID="Data_Accounting_District" runat="server"
     ConnectionString="<%$ ConnectionStrings:ConStr %>" 
        SelectCommand="Select District from Master_Accounting_Sub_Ledger GROUP By District" >
    </asp:SqlDataSource>
     
     <%------------grid--------------------%>
    <telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticDeletes="True" 
        AllowAutomaticInserts="True" AllowAutomaticUpdates="True" 
        DataSourceID="SqlDtLedger" GridLines="None" 
        AutoGenerateColumns="False" Width="800" Skin="Outlook">
        <ExportSettings IgnorePaging="true" OpenInNewWindow="true" FileName="Accural_Primary_Group">
                <Pdf PageHeight="297mm" PageWidth="210mm" PageTitle="Primary Acounts Group" />
                <Excel Format="Html" FileExtension="xls" />
                <Csv ColumnDelimiter="Comma" RowDelimiter="NewLine" FileExtension="CSV" />

        </ExportSettings>
        <MasterTableView DataSourceID="SqlDtLedger" CommandItemDisplay="TopAndBottom"
         AutoGenerateColumns="False" DataKeyNames="Sub_Ledger_ID">
         <EditFormSettings>
                        <EditColumn CancelImageUrl="../image/RadControls/Grid/Skins/Default/Cancel.gif" EditImageUrl="../image/RadControls/Grid/Skins/Default/Edit.gif"
                            InsertImageUrl="../image/RadControls/Grid/Skins/Default/Insert.gif" UniqueName="EditCommandColumn"
                            UpdateImageUrl="../image/RadControls/Grid/Skins/Default/Update.gif">
                        </EditColumn>
                    </EditFormSettings>
           
            <Columns>
                <telerik:GridEditCommandColumn  ButtonType="ImageButton" UniqueName="EditCommandColumn">
                </telerik:GridEditCommandColumn>
                <telerik:GridBoundColumn DataField="Sub_Ledger_ID" DataType="System.Int32" ReadOnly="True" UniqueName="Sub_Ledger_ID" Visible="false" ></telerik:GridBoundColumn>
                <telerik:GridDropDownColumn DataSourceID="Data_Accounting_Ledger_Name" SortExpression="Ledger_ID" ListTextField="Ledger_Name" ListValueField="Ledger_ID" UniqueName="Ledger_ID" DataField="Ledger_ID" DropDownControlType="DropDownList" HeaderText="Ledger"></telerik:GridDropDownColumn>
                <telerik:GridBoundColumn DataField="Sub_Ledger_Name" HeaderText="Sub Ledger Name" UniqueName="Sub_Ledger_Name"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Mailing_Name" HeaderText="Mailing Name" UniqueName="Mailing_Name"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Mailing_Address_1" HeaderText="Mailing Address 1" UniqueName="Mailing_Address_1"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Mailing_Address_2" HeaderText="Mailing Address 2" UniqueName="Mailing_Address_2"></telerik:GridBoundColumn>
                <telerik:GridDropDownColumn DataSourceID="Data_Accounting_District" SortExpression="District" ListTextField="District" ListValueField="District" UniqueName="District" DataField="District" HeaderText="District" DropDownControlType="RadComboBox"></telerik:GridDropDownColumn>
                <telerik:GridBoundColumn DataField="Pin" HeaderText="Pin / Zip" UniqueName="Pin"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Phone" HeaderText="Phone" UniqueName="Phone"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Email" HeaderText="Email" UniqueName="Email"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="CR_Days" HeaderText="Credit Days" UniqueName="CR_Days"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="CR_Limit" HeaderText="Credit Limit" UniqueName="CR_Limit"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Entry_Type" DataType="System.String" ReadOnly="True" UniqueName="Entry_Type" Visible="false" ></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Is_Visiable" DataType="System.String" ReadOnly="True" UniqueName="Is_Visiable" Visible="false" ></telerik:GridBoundColumn>
                <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                        UniqueName="DeleteColumn" ImageUrl="../image/RadControls/Grid/Skins/Default/Delete.gif"></telerik:GridButtonColumn>

            </Columns>
            <EditFormSettings ColumnNumber="4" CaptionDataField="Sub_Ledger_Name" CaptionFormatString="Edit <h6> {0} </h6>">
                <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White" Width="100%" />
                <FormTableStyle CellSpacing="0" CellPadding="2" Height="80px" BackColor="White" />
                <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                <EditColumn ButtonType="ImageButton" InsertText="Insert" UpdateText="Update record"
                            UniqueName="EditCommandColumn1" CancelText="Cancel edit">
                 </EditColumn>
                 <FormTableButtonRowStyle HorizontalAlign="Right"></FormTableButtonRowStyle>
            </EditFormSettings>
            
        </MasterTableView>
        <ClientSettings>
                <ClientEvents OnRowDblClick="RowDblClick" />
        </ClientSettings>

    </telerik:RadGrid>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server"></telerik:RadWindowManager>
Santanu
Top achievements
Rank 1
 answered on 16 Mar 2014
2 answers
61 views
hello ,
im working on project contains two languages (Arabic and English )  every language  has a different style sheet in App_Themes Folder
in this project i have page contains listview some of Elements in this view updated by RadAjaxManager in specific times
if user opening two tab : First tab(the page contains RadListView) and any other tab in same project if user changed Language in other tab (Not RadListView tab)
when ajax fired it cause problem in view of the list view the updated controls in list view take the new language StyleSheet and different controls stay the same
the Summary : RadAjaxManager Update Style sheet when updating the control and take the new one how can i prevent that ?
i hope this finds you will
Regards ,,
Alharith
Top achievements
Rank 1
 answered on 16 Mar 2014
2 answers
131 views
hello
im facing problem in RadWindowManager in Ok button it appears not correct
you can see the problem in attachment

I hope this will find you will
Regards ,,

Alharith
Top achievements
Rank 1
 answered on 16 Mar 2014
0 answers
104 views
I want to build a form where each entry field is either pre-populated
with data from SQL and 'Read Only' (doesn't have to be 'readonly'
strictly speaking but I don't want it to be editable, like a textbox
that's disabled or a label) with an 'edit' button next to the field that
makes it editable, or if there is no data for the field, have it be an
editable textbox.

The wrinkle is that I want the 'edit' buttons
to work client-side.  I've tried javascripts that toggle the 'readonly'
attribute of textboxes, (which I couldn't make work) and I've tried
javascripts that enable/disable the textboxes (which also didn't work). 
Someone the problem I had with these first two approached were with
poastback.  I want to retrieve the value from each field whether it's
been edited or not at postback, and I want the value to return as
whatever it has been changed to after postback.  I had trouble with
both.

I've even tried having two controls, a label and a textbox,
with linked values where only one of the two is ever visible.  I had
trouble getting this approach to render correctly using client-side
code.

Is there an approach that is 'best practice' or that most people use for this?

Thanks.
George
Top achievements
Rank 1
 asked on 15 Mar 2014
4 answers
188 views
hi
i create a grid with item template columns and edit template in batch mode. i want to bind this grid in client side. I have a web service and return a xml string to my java script function . and i add empty function for OnCommand client event .but when i bind the grid it have so many empty rows and if i clear that master Table  in java script is null and i can not bind the grid

what should i do?


English is not my original language so i sorry for my poor language.
thanks
Ali
Top achievements
Rank 1
 answered on 15 Mar 2014
6 answers
639 views
Hi Telerik's team,

I am trying build a radgrid where data should to be grouped in two levels. How can I do this using GroupHeaderTemplate ?
Below is my radgrid. It is grouped by code Primary Key from data. But I need to group then inside a parent group setting header group like a template.

Yet, I just  grouped by ID. How can I group by ParentGroupId too?

<telerik:RadGrid ID="radgrid" runat="server" AutoGenerateColumns="false"
Skin="Silk" Width="90%" Visible="false" AllowMultiRowSelection="true"
AllowSorting="true" AllowPaging="true" ShowStatusBar="true" EnableLinqExpressions="false"
OnItemDataBound="radgrid_ItemDataBound" OnDataBound="radgrid_DataBound"
        CellSpacing="0" GridLines="None" OnPageIndexChanged="radgrid_PageIndexChanged" >
            
<ClientSettings AllowDragToGroup="true" EnableRowHoverStyle="true" AllowColumnsReorder="true"
           Selecting-AllowRowSelect="true" ClientEvents-OnRowDeselected="UnCheckGroup"
  ReorderColumnsOnClient="true" ColumnsReorderMethod="Reorder">
       <Animation AllowColumnReorderAnimation="true" AllowColumnRevertAnimation="true"></Animation>
    </ClientSettings>
    <MasterTableView DataSourceID="ods" DataKeyNames="ID" GroupLoadMode="Client"
             GroupsDefaultExpanded="false" GroupHeaderItemStyle-HorizontalAlign="Left">
            <GroupHeaderTemplate>
          <asp:Label runat="server" ID="Label1" ForeColor="#2F4F4F" Text="Id: "></asp:Label>
          <asp:Label runat="server"
                ID="Label3" Text='<%# (((GridGroupHeaderItem)Container).AggregatesValues["ID"]) %>'></asp:Label>
                       <asp:Label runat="server" ID="Label2" ForeColor="#2F4F4F" Text="Date: "></asp:Label>
           <asp:Label runat="server"  
        ID="Label6" Text='<%# (((GridGroupHeaderItem)Container).AggregatesValues["Date"]) %>'></asp:Label>
           <asp:Label runat="server" ID="Label7" ForeColor="#2F4F4F" Text="Price: $"></asp:Label>
           <asp:Label runat="server"
        ID="Label8" Text='<%# (((GridGroupHeaderItem)Container).AggregatesValues["Price"]) %>'></asp:Label>
       </GroupHeaderTemplate>
       <Columns>
           <telerik:GridBoundColumn DataField="ProductName" UniqueName="ProductName"
HeaderText="Product">
                 <HeaderStyle HorizontalAlign="Center" />
                 <HeaderStyle HorizontalAlign="Center" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Amount" UniqueName="Amount" HeaderText="Amount">
                        <HeaderStyle HorizontalAlign="Center" />
                        <HeaderStyle HorizontalAlign="Center" />
            </telerik:GridBoundColumn>
       </Columns>
       <GroupByExpressions>
             <telerik:GridGroupByExpression>
                   <GroupByFields>
                         <telerik:GridGroupByField FieldName="ParentGroupID"/>
                    </GroupByFields>
            </GroupByExpressions>
            <telerik:GridGroupByExpression>
                    <SelectFields>
                         <telerik:GridGroupByField FieldName="ID"/>
                    </SelectFields>
                    <SelectFields>
                         <telerik:GridGroupByField FieldName="Date"/>
                    </SelectFields>
                    <SelectFields>
                         <telerik:GridGroupByField FieldName="Price"  FormatString="{0:C}"/>
                    </SelectFields>
                    <GroupByFields>
                         <telerik:GridGroupByField FieldName="ID"/>
                    </GroupByFields>
            </telerik:GridGroupByExpression>
        </GroupByExpressions>
         </MasterTableView>
   </telerik:RadGrid>
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="ListItems"
                            TypeName="...my namespace ..."></asp:ObjectDataSource>

Rafael
Top achievements
Rank 1
 answered on 14 Mar 2014
4 answers
433 views
Can I modify the Display text value of DataField value of GridBoundColumn ?
I have "4-code"
and need to display just "Code"


Seems like there should be in-house property to handle this rather than in the data retrieval or the subsequent JavaScript display.
Dan
Top achievements
Rank 1
 answered on 14 Mar 2014
8 answers
176 views
Hello,

I created a simple RadGrid with a NestedViewTemplate and a SqlDataSource1, no code behind involve.  When I click
 expand link and show the static text inside the NestedViewTemplate, I get javascript runtime error:

Unhandled exception at line 6, column 74203 in http://localhost:49573/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=;;System.Web.Extensions,+Version=4.0.0.0,+Culture=neutral,+PublicKeyToken=31bf3856ad364e35:en-US:d618f02c-bda7-40f1-bb64-308e08f719c3:ea597d4b:b25378d2;Telerik.Web.UI:en-US:ac331549-681c-4402-9fb7-09ec3c579ee8:16e4e7cd:f7645509:22a6274a:ed16cbdc:58366029:24ee1bba:f46195d3:2003d0b8:88144a7a:1e771326:aa288e2d

0x800a138f - JavaScript runtime error: Unable to set property 'control' of undefined or null reference


<
telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <script type="text/javascript">
            //Put your JavaScript code here.
        </script>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        </telerik:RadAjaxManager>
        <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" AllowPaging="true">
            <MasterTableView AutoGenerateColumns="False" DataKeyNames="ProductID" DataSourceID="SqlDataSource1">
                <Columns>
                    <telerik:GridBoundColumn DataField="ProductID" DataType="System.Int32" FilterControlAltText="Filter ProductID column" HeaderText="ProductID" ReadOnly="True" SortExpression="ProductID" UniqueName="ProductID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Name" FilterControlAltText="Filter Name column" HeaderText="Name" SortExpression="Name" UniqueName="Name">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ProductNumber" FilterControlAltText="Filter ProductNumber column" HeaderText="ProductNumber" SortExpression="ProductNumber" UniqueName="ProductNumber">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Size" FilterControlAltText="Filter Size column" HeaderText="Size" SortExpression="Size" UniqueName="Size">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Color" FilterControlAltText="Filter Color column" HeaderText="Color" SortExpression="Color" UniqueName="Color">
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="MakeFlag" DataType="System.Boolean" FilterControlAltText="Filter MakeFlag column" HeaderText="MakeFlag" SortExpression="MakeFlag" UniqueName="MakeFlag">
                    </telerik:GridCheckBoxColumn>
                </Columns>
                <NestedViewTemplate>
                    dssfaddfssd
                </NestedViewTemplate>
            </MasterTableView>
        </telerik:RadGrid>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:AdventureWorks2008R2ConnectionString %>" SelectCommand="SELECT [ProductID], [Name], [ProductNumber], [Size], [Color], [MakeFlag] FROM [Production].[Product]"></asp:SqlDataSource>

If above code added to a RadControlWebApp project, it is running fine.  But if it added to a existing ASP.NET
 Web Forms Application. Also, I made sure that Telerik.Web.UI and Skins are added to references and web.config

What am I missing here to make NestedViewTemplate to work? It stopped working in Q3 2013 after upgraded.

Thanks in advance
Sam
David Hoffman
Top achievements
Rank 1
 answered on 14 Mar 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?