Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
115 views

Hi,

I'm using Dual ListBox with the source and destination are databound to their respective datatables. After transfer to the right, the datatable is not updating and remains empty. I've tried both RadAjaxPanel and ASP UpdatePanel, the result is the same. 

Telerik Version: 

2014.1.403.45

ASPX:

001.<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
002.<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
003.<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
004.<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
005.<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
006.<%@ Import Namespace="Microsoft.SharePoint" %>
007.<%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
008. 
009.<%@ Page Language="VB" AutoEventWireup="true" CodeBehind="PhoneBookPicker.aspx.vb" Inherits="XXXXXPortalAdditions.Layouts.XXXXXXPortalAdditions.Pages.PhoneBookPicker" DynamicMasterPageFile="~masterurl/default.master" %>
010. 
011.<%@ Register Assembly="Telerik.Web.UI, Version=2014.1.403.45, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
012. 
013.<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
014.</asp:Content>
015. 
016.<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
017. 
018.    <!--This is where we hide the not needed default SharePoint elements and fix margins -->
019.    <script type="text/javascript">
020.        $(document).ready(function () {
021. 
022.            $('#sideNavBox').css('display', 'none');
023.            $('#contentRow').css('padding-top', '0px');
024.            $('#contentBox').css({ 'margin-right': '0px', 'margin-left': '0px' })
025. 
026.        });
027.    </script>
028. 
029. 
030. 
031.    <input id="usrSearch" type="search" placeholder="חיפוש..." style="width: 154px; height: 25px; margin-bottom: 5px; margin-top: 2px; margin-right: 1px; background: url('/_layouts/15/images/XXXXXPortalAdditions/apps_search.png') no-repeat 6px 6px;" dir="rtl" />
032.    <div dir="ltr" style="margin-top: 40px; text-align: center;">
033. 
034.        <%-- <telerik:RadFormDecorator ID="RadFormDecorator1" DecoratedControls="All" runat="server" />
035.        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">--%>
036.        <asp:UpdateProgress ID="updProgress" AssociatedUpdatePanelID="UpdatePanelAddFavs" runat="server">
037.            <ProgressTemplate>
038.                <div class="animationload">
039.                    <span>טוען...</span>
040.                    <div class="preloader"></div>
041.                </div>
042.            </ProgressTemplate>
043.        </asp:UpdateProgress>
044.        <asp:UpdatePanel runat="server" ID="UpdatePanelAddFavs" UpdateMode="Conditional" Visible="True">
045.            <ContentTemplate>
046. 
047.                <telerik:RadListBox ID="RadListBoxSource" runat="server" AllowTransfer="true" AllowAutomaticUpdates="True" AutoPostBackOnTransfer="true" AllowDelete="false" EnableDragAndDrop="true" SelectionMode="Multiple" ButtonSettings-ShowTransferAll="false" Localization-ToLeft="העבר חזרה לרשימה כללית" Localization-ToRight="העבר לקבוצת מועדפים שלי" Localization-MoveDown="הזז למטה" Localization-MoveUp="הזז למעלה" TransferToID="RadListBoxDestination" Height="400px" Width="300px"></telerik:RadListBox>
048. 
049.                <telerik:RadListBox ID="RadListBoxDestination" runat="server" AllowReorder="true" AllowAutomaticUpdates="True" AutoPostBackOnTransfer="true" EnableDragAndDrop="true" AllowDelete="false" SelectionMode="Multiple" Height="400px" Width="300px"></telerik:RadListBox>
050.                <div id="divButtons">
051.                    <asp:Button ID="btnSubmitFav" runat="server" Text="שמור שינויים" Height="40px" Width="80px" OnClick="btnSubmitFav_Click" />
052.                </div>
053.                <div id="divError" runat="server"></div>
054.                <%-- </telerik:RadAjaxPanel>--%>
055. 
056.            </ContentTemplate>
057.        </asp:UpdatePanel>
058.    </div>
059. 
060. 
061.    <!--This is where we filter the Listbox left side for XXXXX employees via keystrokes -->
062.    <!--I take the already existing class that the control adds to all the items and I work with it - class ".rlbItem" -->
063.    <script type="text/javascript">
064.        $(document).ready(
065.         function () {
066.             var $users = $('.rlbItem');
067.             $('#usrSearch').keyup(function () {
068.                 if ($.trim($(this).val()) == "") {
069.                     $users.show();
070.                     return;
071.                 }
072.                 var val = $.trim($(this).val()).replace(/ +/g, ' ').toLowerCase();
073. 
074.                 $users.show().filter(function () {
075.                     var text = $(this).text().replace(/\s+/g, ' ').toLowerCase();
076.                     return !~text.indexOf(val);
077.                 }).hide();
078.             });
079. 
080. 
081.         }
082.       );
083.    </script>
084.    <!--This is where we prevent default Enter key functionality -->
085.    <script type="text/javascript">
086.        $(document).ready(function () {
087.            $('.prvntEnterKey').bind('keypress', function (e) {
088.                if (e.keyCode == 13) {
089.                    e.preventDefault();
090. 
091.                }
092.            });
093.        });
094.    </script>
095.</asp:Content>
096. 
097.<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
098.</asp:Content>
099. 
100.<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server">
101.</asp:Content>

 

CodeBehind:

001.Imports System
002.Imports Microsoft.SharePoint
003.Imports Microsoft.SharePoint.WebControls
004.Imports MyDal
005.Imports System.Web.UI
006.Imports Telerik.Web.UI
007.Imports System.Text
008.Imports System.Web.UI.WebControls
009. 
010.Namespace Layouts.MyPortalAdditions.Pages
011. 
012.    Partial Public Class PhoneBookPicker
013.        Inherits LayoutsPageBase
014. 
015.#Region "Properties"
016.        'Private Property SrcTable() As DataTable
017.        '    Get
018.        '        Return CType(ViewState("SrcTable"), DataTable)
019.        '    End Get
020.        '    Set(ByVal value As DataTable)
021.        '        ViewState("SrcTable") = value
022.        '    End Set
023.        'End Property
024. 
025.        'Private Property DestTable() As DataTable
026.        '    Get
027.        '        Return CType(ViewState("DestTable"), DataTable)
028.        '    End Get
029.        '    Set(ByVal value As DataTable)
030.        '        ViewState("DestTable") = value
031.        '    End Set
032.        'End Property
033. 
034.        Private m_SrcTable As DataTable
035.        Public Property SrcTable() As DataTable
036.            Get
037.                Return m_SrcTable
038.            End Get
039.            Set(ByVal value As DataTable)
040.                m_SrcTable = value
041.            End Set
042.        End Property
043. 
044.        Private m_DestTable As DataTable
045.        Public Property DestTable() As DataTable
046.            Get
047.                Return m_DestTable
048.            End Get
049.            Set(ByVal value As DataTable)
050.                m_DestTable = value
051.            End Set
052.        End Property
053. 
054.        Private s_user As String
055.        Public Property sUser() As String
056.            Get
057.                Return s_user
058.            End Get
059.            Set(ByVal value As String)
060.                s_user = value
061.            End Set
062.        End Property
063.#End Region
064. 
065.#Region "Initializations"
066. 
067.        Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
068. 
069.            If Not Page.IsPostBack Then
070.                initUser()
071.                initSrcTable()
072.                initDestTable()
073.                initRadListBoxSource()
074.                initRadListBoxDestination()
075.            End If
076. 
077.        End Sub
078. 
079.        Private Sub initUser()
080.            Dim oWeb As SPWeb = SPContext.Current.Web
081.            sUser = MyUtilities.GetCurrentUserLoginName(oWeb)
082.        End Sub
083. 
084.        Private Sub initSrcTable()
085.            Dim sMyDal As MyDal.SqlDal
086.            Dim connStr As String = ListsProvider.My_CONN_STR
087.            sMyDal = New SqlDal(connStr, True)
088.            Dim SPName As String = "PRS_MyData.dbo.USP_Get_EmployeePhone"
089.            Dim paramArr As SqlParams
090.            Try
091. 
092.                paramArr = New SqlParams
093.                paramArr.Add(New SqlParam("@SearchName", SqlParam.ParamType.ptChar, SqlParam.ParamDirection.pdInput, ""))
094.                SrcTable = sMyDal.ExecuteSPReturnDT(SPName, paramArr)
095. 
096.            Catch ex As Exception
097.                divError.Controls.Add(New LiteralControl("<div>Exception: " & ex.Message & "</div>"))
098.            Finally
099.                sMyDal = Nothing
100.            End Try
101. 
102.        End Sub
103. 
104.        Private Sub initDestTable()
105.            Dim sMyDal As MyDal.SqlDal
106.            Dim connStr As String = ListsProvider.My_CONN_STR
107.            sMyDal = New SqlDal(connStr, True)
108.            Dim SPName As String = "PRS_MyData.dbo.USP_PIE_GET_PERSONAL_LIST"
109.            Dim paramArr As SqlParams
110.            Try
111. 
112.                paramArr = New SqlParams
113.                paramArr.Add(New SqlParam("@AD_USER", SqlParam.ParamType.ptChar, SqlParam.ParamDirection.pdInput, sUser))
114.                DestTable = sMyDal.ExecuteSPReturnDT(SPName, paramArr)
115.                DestTable.AcceptChanges()
116. 
117.            Catch ex As Exception
118.                divError.Controls.Add(New LiteralControl("<div>Exception: " & ex.Message & "</div>"))
119.            Finally
120.                sMyDal = Nothing
121.            End Try
122.        End Sub
123. 
124.        Private Sub initRadListBoxSource()
125.            RadListBoxSource.DataSource = SrcTable
126.            RadListBoxSource.DataTextField = "Emp Name"
127.            RadListBoxSource.DataKeyField = "Employeeno"
128.            RadListBoxSource.DataBind()
129.        End Sub
130. 
131.        Private Sub initRadListBoxDestination()
132.            RadListBoxDestination.DataSource = DestTable
133.            RadListBoxDestination.DataTextField = "name"
134.            RadListBoxDestination.DataKeyField = "EMPNO"
135.            RadListBoxDestination.DataBind()
136.        End Sub
137. 
138.#End Region
139. 
140.#Region "DB Actions"
141. 
142.        Private Sub deleteFavoritesFromDB()
143.            Dim dt As DataTable
144.            Dim sMyDal As MyDal.SqlDal
145.            Dim connStr As String = ListsProvider.My_CONN_STR
146.            sMyDal = New SqlDal(connStr, True)
147.            Dim sSqlSelect As String = "Select * from PRS_MyData.dbo.Pie_Personal_List where AD_USER = '" & sUser & "'"
148.            Dim sSqlDelete As String = "Delete from PRS_MyData.dbo.Pie_Personal_List where AD_USER = '" & sUser & "'"
149.            Try
150.                dt = sMyDal.GetDataTable(sSqlSelect)
151.                If dt.Rows.Count > 0 Then
152.                    sMyDal.ExecuteSql(sSqlDelete)
153.                End If
154.            Catch ex As Exception
155.                divError.Controls.Add(New LiteralControl("<div>Exception: " & ex.Message & "</div>"))
156.            Finally
157.                sMyDal = Nothing
158.                dt = Nothing
159.            End Try
160.        End Sub
161. 
162.        Private Sub writeFavoritesToDB()
163.            Dim row As DataRow
164.            Dim sMyDal As MyDal.SqlDal
165.            Dim connStr As String = ListsProvider.My_CONN_STR
166.            sMyDal = New SqlDal(connStr, True)
167.            Dim SPname As String = "PRS_MyData.dbo.USP_PIE_ADD_PERSONAL_LIST_ITEM"
168.            Dim paramArr As SqlParams
169. 
170.            Try
171.                For Each row In DestTable.Rows
172.                    paramArr = New SqlParams
173.                    paramArr.Add(New SqlParam("@name", SqlParam.ParamType.ptChar, SqlParam.ParamDirection.pdInput, sUser))
174.                    paramArr.Add(New SqlParam("@EMPNO", SqlParam.ParamType.ptChar, SqlParam.ParamDirection.pdInput, row("empno").ToString()))
175.                    sMyDal.ExecuteSP(SPname, paramArr)
176.                Next
177. 
178.            Catch ex As Exception
179.                divError.Controls.Add(New LiteralControl("<div>Exception: " & ex.Message & "</div>"))
180.            Finally
181.                sMyDal = Nothing
182.            End Try
183.        End Sub
184. 
185.#End Region
186. 
187.#Region "Events"
188. 
189.        Protected Sub btnSubmitFav_Click(sender As Object, e As EventArgs)
190. 
191.            deleteFavoritesFromDB()
192.            If RadListBoxDestination.Items.Count > 0 Then
193.                writeFavoritesToDB()
194.            End If
195. 
196. 
197.        End Sub
198. 
199.#End Region
200. 
201. 
202.    End Class
203. 
204.End Namespace

Thanks in Advance!

Revital
Top achievements
Rank 1
 answered on 30 Jun 2016
2 answers
513 views
In case this helps someone else: I was having difficulty with my column RadHTMLChart. There were no exceptions but it wouldn't display the data. I was binding to a dataview and setting the DataFieldY and DataLabelsField to columns in that dataview. Long story short, it seems that there are certain reserved words that the chart has trouble with. In my case, my dataview had a column named "count" and a column named "Category". I changed my SQL query to give the column names the aliases of "ErrCount" and "CategoryName", changed the chart's DataFieldY and DataLabelsField properties to use these new column names, and then the chart displayed correctly.

While I have solved my problem, I'm wondering if there is documentation which lists reserved keywords so I don't run into this again?
Pratik
Top achievements
Rank 1
 answered on 30 Jun 2016
1 answer
96 views

I have an aspx page with a master page and a css file set on the master page.  In my Rad grid I set the Heder Style to this

<HeaderStyle CssClass="Myheader" /> and in my .css file I added the following class:

.Myheader
{
    background-color:red !important
}

My Header still has a black background color

 

Can anyone see a problem here?

 

Eyup
Telerik team
 answered on 30 Jun 2016
5 answers
704 views
I have a RadCombBox and RadButton like this:

<telerik:RadButton runat="server" id="btnPlantName" OnClick="btnPlantName_Click" Text="Filter"/><br />
        <label for="" class="filterElement">Plant Name: </label>
        <telerik:RadComboBox
            ID="RadComboBoxPlantName"
            DataSourceID="SqlPlantNameList"
            DataTextField="PlantName"
            DataValueField="PlantName"
            AppendDataBoundItems="true"
            runat="server"
            OnClientSelectedIndexChanged="PlantIndexChanged"
            class="filterElement" EnableLoadOnDemand="false"
            CheckBoxes="true" EnableCheckAllItemsCheckBox="true">            
        </telerik:RadComboBox>

And my code behind is set up like this: 

protected void btnPlantName_Click(object sender, EventArgs e)
{
   FilterByComboBox(RadComboBoxPlantName, "PlantName");
}
 
private void FilterByComboBox(RadComboBox box, string columnName)
        {
            var selectedItems = box.CheckedItems;
            List<string> values = new List<string>();
 
            if (selectedItems.Count != 0)
            {
                foreach (var item in selectedItems)
                    values.Add(item.Text);
 
                FilterColumnByMultipleValues(columnName, values.ToArray());
            }           
        }

When I step through the code, the event is fired properly, but box.CheckItems is always zero.  Why is this?  I need to be able to get all the values.

Thanks!
Nencho
Telerik team
 answered on 30 Jun 2016
1 answer
128 views

hi,

I have a radpanelbar on our page, on one of the panels we have radgrid with client side databinding in HeaderTemplate of a panelitem. The grid has GridboundColumns. When data is bound, the grid shows empty values for all columns of all rows.However if I move the grid to content template of panelitem then there is no such issue.

 

What is causing this problem? Is there anyway we can resolve this issue?

 

Regards,

Kiran

Ivan Danchev
Telerik team
 answered on 30 Jun 2016
3 answers
496 views
Hi,
i am displaying a radwindow in my page and i just want to display the close button. All other buttons i need to hide. please help.

Thanks,
Teena
Marin Bratanov
Telerik team
 answered on 30 Jun 2016
1 answer
101 views

Hi , 

While changing a selected index of a Kendodropdownlist i am getting the below error .

Failed to load resource: net::ERR_CONTENT_DECODING_FAILED

when i see the network tab on the brower i'm getting the below error.

Status : Failed

Type : xhr

initiator : Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=scriptManager_TSM&compress=1&_TSM_CombinedScripts

And the grid in the next step unable to load. 

Kindly help me with this issue . 

Regards,
Rajiv

Nencho
Telerik team
 answered on 30 Jun 2016
1 answer
1.5K+ views
I am facing infinite loader spinning issue in Summit my application on testing environment. I have tried replicating the same on local and Dev environments and both are working good.

We found the issues to be replicating on testing environment only.

I am getting the below error Failed to load resource: net::ERR_CONTENT_DECODING_FAILED.

If possible, please provide your valuable inputs to enlighten us so that we can move ahead to resolve these issues.
Maria Ilieva
Telerik team
 answered on 29 Jun 2016
1 answer
66 views

Hi,

I am using RadScheduler, I would like to select multiple days in the year view just as I can select in a month view.

Is it possible to select multiple days in the year view of RadScheduler?

Thanks,

Jalil

Peter Milchev
Telerik team
 answered on 29 Jun 2016
3 answers
81 views

- 2 Grid on 1 Page it Work
- 3 Grid on 1 Page Not Work. 

>> RadGrid  working to Grid1_BatchEditCommand and Grid3_BatchEditCommand Not working to Grid2_BatchEditCommand <<

 

<head>
    <title>Test</title>
    <script type="text/javascript">
 
         function SaveGrid(sender, args) {
 
            var grid1 = $find('<%=RadGrid1.ClientID%>');
            var grid1changes = grid1.get_batchEditingManager()._extractChangesString(grid1.get_masterTableView());
            if (grid1changes.length > 0) {
                grid1.get_masterTableView().fireCommand("BatchEdit", grid1changes);
            }
 
            var grid2 = $find('<%= RadGrid2.ClientID%>');
            var grid2changes = grid2.get_batchEditingManager()._extractChangesString(grid2.get_masterTableView());
            if (grid2changes.length > 0) {
                 grid2.get_masterTableView().fireCommand("BatchEdit", grid2changes);
            }
 
            var grid3 = $find('<%= RadGrid3.ClientID%>');
            var grid3changes = grid3.get_batchEditingManager()._extractChangesString(grid3.get_masterTableView());
            if (grid3changes.length > 0) {
                grid3.get_masterTableView().fireCommand("BatchEdit", grid3changes);
            }
 
        }
 
    </script>
</head>
<body>
    <form id="Form1" runat="server">
        <telerik:RadScriptManager Runat="server"></telerik:RadScriptManager>
           
           
        <telerik:RadButton runat="server" ID="RadButton1" Text="SaveAllChanges" AutoPostBack="false" OnClientClicked="SaveGrid"></telerik:RadButton>
   
           
        <telerik:GridNumericColumnEditor ID="NumericEditor1" runat="server">
            <NumericTextBox ID="NumericTextBox1" runat="server" Width="60px" />
        </telerik:GridNumericColumnEditor>
           
        <telerik:GridTextBoxColumnEditor runat="server" ID="TextEditor">
            <TextBoxStyle Width="120px" />
        </telerik:GridTextBoxColumnEditor>
   
        <!--Grid1------------>
 
        <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource3"
            AllowPaging="True" AllowAutomaticUpdates="True" AllowAutomaticInserts="True"
            AllowAutomaticDeletes="true" AllowSorting="true" PageSize="3" >
            <PagerStyle Mode="NextPrevAndNumeric" />
            <MasterTableView DataSourceID="SqlDataSource3" AutoGenerateColumns="False"
                DataKeyNames="CustomerID" EditMode="Batch" CommandItemDisplay="Top">
                <Columns>
        
                    <telerik:GridBoundColumn DataField="CustomerID" HeaderText="CustomerID" SortExpression="CustomerID"
                        UniqueName="CustomerID">
                    </telerik:GridBoundColumn>
   
   
                   <telerik:GridTemplateColumn HeaderText="ContactName" HeaderStyle-Width="180px" UniqueName="ContactName" >
                        <ItemTemplate>
                            <%# Eval("ContactName") %>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" Text='<%# Bind("ContactName") %>' runat="server"></asp:TextBox>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
   
   
                    <telerik:GridBoundColumn DataField="CompanyName" HeaderText="CompanyName" SortExpression="CompanyName"
                        UniqueName="CompanyName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ContactTitle" HeaderText="ContactTitle" SortExpression="ContactTitle"
                        UniqueName="ContactTitle">
                    </telerik:GridBoundColumn>
                
   
                       
                 <telerik:GridBoundColumn DataField="Phone" HeaderStyle-Width="135px" HeaderText="Quantity Per Unit"
                        SortExpression="" ColumnEditorID="TextEditor" UniqueName="QuantityPerUnit">
                    </telerik:GridBoundColumn>
   
   
                    <telerik:GridButtonColumn Text="Delete" CommandName="Delete" ButtonType="ImageButton" />
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
   
     
        <!--Grid2------------>
   
        <telerik:RadGrid ID="RadGrid2" GridLines="None" runat="server" AllowAutomaticDeletes="True"
            AllowAutomaticInserts="True" PageSize="3" Skin="Default" AllowAutomaticUpdates="True" AllowPaging="True"
            AutoGenerateColumns="False" Width="750px" DataSourceID="SqlDataSource1">
   
            <MasterTableView CommandItemDisplay="TopAndBottom" DataKeyNames="ProductID"
                DataSourceID="SqlDataSource1" HorizontalAlign="NotSet" EditMode="Batch" AutoGenerateColumns="False">
                <BatchEditingSettings EditType="Cell" />
                <SortExpressions>
                    <telerik:GridSortExpression FieldName="ProductID" SortOrder="Descending" />
                </SortExpressions>
                <Columns>
                    <telerik:GridBoundColumn DataField="ProductName" HeaderStyle-Width="210px" HeaderText="ProductName" SortExpression="ProductName"
                        UniqueName="ProductName">
                        <ColumnValidationSettings EnableRequiredFieldValidation="true">
                            <RequiredFieldValidator ForeColor="Red" Text="*This field is required">
                            </RequiredFieldValidator>
                        </ColumnValidationSettings>
                    </telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn HeaderText="Category" HeaderStyle-Width="180px" UniqueName="CategoryID" DataField="CategoryID">
                        <ItemTemplate>
                            <%# Eval("CategoryName") %>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadDropDownList runat="server" ID="CategoryIDDropDown" DataValueField="CategoryID"
                                DataTextField="CategoryName" DataSourceID="SqlDataSource2">
                            </telerik:RadDropDownList>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridNumericColumn DataField="UnitsInStock" HeaderStyle-Width="80px"
                        ColumnEditorID="NumericEditor1" HeaderText="Units In Stock" SortExpression="UnitsInStock"
                        UniqueName="UnitsInStock">
                    </telerik:GridNumericColumn>
                    <telerik:GridBoundColumn DataField="QuantityPerUnit" HeaderStyle-Width="135px" HeaderText="Quantity Per Unit"
                        SortExpression="QuantityPerUnit" ColumnEditorID="TextEditor" UniqueName="QuantityPerUnit">
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="Discontinued" HeaderStyle-Width="80px" HeaderText="Discontinued" SortExpression="Discontinued"
                        UniqueName="Discontinued">
                    </telerik:GridCheckBoxColumn>
                    <telerik:GridTemplateColumn HeaderText="UnitPrice" ColumnEditorID="NumericEditor1"
                        HeaderStyle-Width="80px" SortExpression="UnitPrice" UniqueName="TemplateColumn"
                        DataField="UnitPrice">
                        <ItemTemplate>
                            <asp:Label runat="server" ID="lblUnitPrice" Text='<%# Eval("UnitPrice", "{0:C}") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <span>
                                <telerik:RadNumericTextBox Width="55px" runat="server" ID="tbUnitPrice">
                                </telerik:RadNumericTextBox>
                                <span style="color: Red">
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1"
                                        ControlToValidate="tbUnitPrice" ErrorMessage="*Required" runat="server">
                                    </asp:RequiredFieldValidator>
                                </span>
                            </span>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"
                        ConfirmTitle="Delete" HeaderText="Delete" HeaderStyle-Width="50px" ButtonType="ImageButton"
                        CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                    </telerik:GridButtonColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
 
 
        <!--Grid3------------>
   
        <telerik:RadGrid ID="RadGrid3" GridLines="None" runat="server" AllowAutomaticDeletes="True"
            AllowAutomaticInserts="True" PageSize="3" Skin="Default" AllowAutomaticUpdates="True" AllowPaging="True"
            AutoGenerateColumns="False" Width="750px" DataSourceID="SqlDataSource1">
   
            <MasterTableView CommandItemDisplay="TopAndBottom" DataKeyNames="PersonID"
                DataSourceID="SqlDataSource1" HorizontalAlign="NotSet" EditMode="Batch" AutoGenerateColumns="False">
                <BatchEditingSettings EditType="Cell" />
                <SortExpressions>
                    <telerik:GridSortExpression FieldName="PersonID" SortOrder="Descending" />
                </SortExpressions>
                <Columns>
                    <telerik:GridBoundColumn DataField="PersonName" HeaderStyle-Width="210px" HeaderText="PersonName" SortExpression="PersonName"
                        UniqueName="PersonName">
                        <ColumnValidationSettings EnableRequiredFieldValidation="true">
                            <RequiredFieldValidator ForeColor="Red" Text="*This field is required">
                            </RequiredFieldValidator>
                        </ColumnValidationSettings>
                    </telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn HeaderText="Position" HeaderStyle-Width="180px" UniqueName="PositionID" DataField="PositionID">
                        <ItemTemplate>
                            <%# Eval("PositionName")%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadDropDownList runat="server" ID="PositionIDDropDown" DataValueField="PositionID"
                                DataTextField="PositionName" DataSourceID="SqlDataSource2">
                            </telerik:RadDropDownList>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridNumericColumn DataField="PersonNickname" HeaderStyle-Width="80px"
                        ColumnEditorID="NumericEditor1" HeaderText="Nickname" SortExpression="Nickname"
                        UniqueName="Nickname">
                    </telerik:GridNumericColumn>
                    <telerik:GridBoundColumn DataField="PersonContract" HeaderStyle-Width="135px" HeaderText="Contract"
                        SortExpression="PersonContract" ColumnEditorID="TextEditor" UniqueName="PersonContract">
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="PersonFundNumb" HeaderStyle-Width="80px" HeaderText="PersonFundNumb" SortExpression="PersonFundNumb"
                        UniqueName="PersonFundNumb">
                    </telerik:GridCheckBoxColumn>
                    <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"
                        ConfirmTitle="Delete" HeaderText="Delete" HeaderStyle-Width="50px" ButtonType="ImageButton"
                        CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                    </telerik:GridButtonColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
   
</form
</body
 
<!-----------Behind Code ----------->
 
 Protected Sub Grid1_BatchEditCommand(sender As Object, e As GridBatchEditingEventArgs) Handles Grid1.BatchEditCommand
        If e.Commands.Count > 0 Then
            '.............................................
        End If
    End Sub
 
<!-----------Not Working Grid2_BatchEditCommand  ----------->
    Protected Sub Grid2_BatchEditCommand(sender As Object, e As GridBatchEditingEventArgs) Handles Grid2.BatchEditCommand
        If e.Commands.Count > 0 Then
            '.............................................
        End If
    End Sub
 
    Protected Sub Grid3_BatchEditCommand(sender As Object, e As GridBatchEditingEventArgs) Handles Grid3.BatchEditCommand
        If e.Commands.Count > 0 Then
            '.............................................
        End If
    End Sub
Viktor Tachev
Telerik team
 answered on 29 Jun 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?