Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
98 views
I setup the Grid at server side
MyGrid.MasterTableView.IsItemInserted = true

so user can direct edit the record
also include a new record at bottom for insertion.

problem when record is created and returned to client side Grid, the row's cells are empty.
the Row is expected to have 1st cell with RadComboBox, 2nd cell with radnumerictextbox, and 3rd cell is customized with LinkButton

records are created successfully at server side through Ajax method, and return correctly by checking the result.d.ResultList.length.
Konstantin Dikov
Telerik team
 answered on 20 Nov 2014
1 answer
136 views
I need to have a property show up when an item is being edited, but I don't have an ItemTemplate for it. The reason for it, is because I am using GroupByExpressions to show the values of those records. In order to get those properties to show up in Edit mode, here's what I did:

<telerik:GridTemplateColumn HeaderText="Report Period" UniqueName="ReportPeriodName" Visible="False" Display="False">
    <EditItemTemplate>
        <asp:DropDownList runat="server" ID="ddlReportPeriod" AppendDataBoundItems="True">
            <asp:ListItem Text="-- Select Reporting Period --" Value="" />
        </asp:DropDownList>
    </EditItemTemplate>
</telerik:GridTemplateColumn>

But, I can still see that it's rendering a column (but an empty one). What would be a better approach?
Konstantin Dikov
Telerik team
 answered on 20 Nov 2014
1 answer
370 views
Hello,

I am trialing the radgrid controls and am having an issue with the batch update mode.

I have the following html in aspx:
<telerik:RadGrid ID="RadGrid_MobileCheckList" runat="server"
                AutoGenerateColumns="False" GridLines="Vertical" AllowMultiRowEdit="true"
                HeaderStyle-CssClass="radGridHeaderStyle"
                onitemdatabound="RadGrid_MobileCheckList_ItemDataBound"
                onprerender="RadGrid_MobileCheckList_PreRender"
                onitemcommand="RadGrid_MobileCheckList_ItemCommand">
                <MasterTableView DataKeyNames="MobileChecklist_ID, MobileResponseType_ID, MobileResponse_ID" EditMode="Batch" CommandItemDisplay="Bottom">
                    <Columns>
                        <telerik:GridBoundColumn AllowSorting="true" HeaderStyle-Width="20%" ItemStyle-CssClass="radGridItemStyle" ReadOnly="true" DataField="Task" HeaderText="Task"></telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="10%" ItemStyle-CssClass="radGridItemStyle" HeaderText="Response" UniqueName="">
                            <EditItemTemplate>
                                <telerik:RadComboBox runat="server" ID="MobileChecklistGrid_RadComboBox_Response" ondatabound="MobileChecklistGrid_RadComboBox_Response_DataBound" Width="100%" DataTextField="Response" DataValueField="MobileResponse_ID"></telerik:RadComboBox>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="70%" ItemStyle-CssClass="radGridItemStyle" HeaderText="Comment">
                            <EditItemTemplate>
                                <telerik:RadTextBox runat="server" ID="MobileChecklistGrid_TextBox_Comment" Width="100%" Text='<%# Eval("Comment") %>'></telerik:RadTextBox>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" />
                    </Columns>
                    <CommandItemTemplate>
                        <asp:Button runat="server" ID="UpdateAll" Text="Update All" CommandName="UpdateAll" />
                    </CommandItemTemplate>
                </MasterTableView>
            </telerik:RadGrid>


This grid is populated on a selected row event from another grid:
protected void RadGrid_CheckList_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
    {
        if (e.CommandName == "RowClick")
        {
            GridDataItem item = (GridDataItem)e.Item;
        string checklistId = item["Checklist_ID"].Text;
            DataTable table = _domain.GetMobileCheckListDetailsByCheckListId(checklistId);
 
            RadGrid_MobileCheckList.DataSource = table;
            RadGrid_MobileCheckList.DataBind();
        }
    }


Also, I am populating the combobox that is embedded in the radgrid on the ItemDataBound Event:
protected void RadGrid_MobileCheckList_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            if (e.Item is GridEditableItem && e.Item.IsInEditMode)
            {
                GridEditableItem item = (GridEditableItem)e.Item;
                RadComboBox rcb = item.FindControl("MobileChecklistGrid_RadComboBox_Response") as RadComboBox;
 
                if (rcb != null)
                {
                    int? responseTypeId = !string.IsNullOrEmpty(item.GetDataKeyValue("MobileResponseType_ID").ToString()) ? int.Parse(item.GetDataKeyValue("MobileResponseType_ID").ToString()) : (int?)null;
                    if (responseTypeId != null)
                        {
                           DataTable table =  _domain.GetMobileResponsesByResponseTypeID(responseTypeId);
                           comboBox.DataSource = table;
                           comboBox.DataValueField = table.Columns[valueField].ToString();
                           comboBox.DataTextField = table.Columns[textField].ToString();
                           comboBox.DataBind();
                           comboBox.SelectedIndex = -1;
                        }
                }
 
            }
        }
    }


Finally, I am setting each row as editable in the PreRender event:
protected void RadGrid_MobileCheckList_PreRender(object sender, EventArgs e)
   {
       foreach (GridDataItem dataItem in RadGrid_MobileCheckList.Items)
       {
           dataItem.Edit = true;
       }
       RadGrid_MobileCheckList.Rebind();
   }


When the "Update All" button is clicked I am iterating through each row to determine if there are updates in the ItemCommand Event:
I have tried many differnt things here but the results from the ExtractValuesFromItem is always Count=0.

protected void RadGrid_MobileCheckList_ItemCommand(object sender, GridCommandEventArgs e)
    {
        if (e.CommandName == "UpdateAll")
        {
            foreach (GridEditableItem editedItem in RadGrid_MobileCheckList.EditItems)
            {
                Hashtable newValues = new Hashtable();
                Hashtable oldValues = new Hashtable();
                oldValues = (Hashtable)editedItem.SavedOldValues;
                e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem);
                editedItem.ExtractValues(newValues);
 
               //I can get the items with something like this:
               //But I dont want to update every row everytime, I need to know which items have been actually edited. Something like an isDirty property.
                 var test = ((RadComboBox)editedItem.Cells[3].Controls[1]).SelectedItem;
                 var test2 = ((RadTextBox)editedItem.Cells[4].Controls[1]).Text;
            }
        }
    }

How can I determine if the row has actually changed? I don't want to update every row, only the items that have actually been changed.

Thanks,






















​
Angel Petrov
Telerik team
 answered on 20 Nov 2014
1 answer
69 views
Hi guys,

I wonder if this following is possible.
Currently, I have
(picture 1).
and code:
<telerik:RadGrid ID="rgQueryResult" runat="server" AutoGenerateColumns="true" AllowFilteringByColumn="true"
    OnNeedDataSource="QueryResult_NeedDataSource"
    AllowSorting="true"
    AllowPaging="true"
    EnableLinqExpressions="true"
    OnItemCommand="QueryResult_ItemCommand"
    OnItemCreated="QueryResult_ItemCreated"
    >
    <ExportSettings ExportOnlyData="true">
    </ExportSettings>
    <MasterTableView CommandItemDisplay="Top">
        <CommandItemSettings ShowAddNewRecordButton="false" ShowExportToCsvButton="false"
            ShowRefreshButton="false" ShowExportToExcelButton="false"  />
    </MasterTableView>
    <ClientSettings AllowColumnsReorder="true">
        <Scrolling AllowScroll="true"></Scrolling>
         
    </ClientSettings>
</telerik:RadGrid>

Is it possible to add another row of filters (dropdown)?
The datasource is user created sql query so I don't know in advance.

Thank you!
Kostadin
Telerik team
 answered on 20 Nov 2014
2 answers
76 views
When I try to select a row, the row is not highlighted and I am not sure why.

Markup:

<telerik:RadGrid ID="dgRates" runat="server" AllowSorting="false" AutoGenerateColumns="False" Skin="Web20" PageSize="200" GridLines="None" Width="390px" AllowPaging="True" TabIndex="-1" EnableEmbeddedSkins="true" OnBiffExporting="RadGrid_BiffExporting">
              <PagerStyle Position="Bottom" Mode="NumericPages" PageButtonCount="10" AlwaysVisible="true" />
              <ClientSettings>
                <Scrolling UseStaticHeaders="True" AllowScroll="True" ScrollHeight="300px"></Scrolling>
                <Resizing ResizeGridOnColumnResize="True" ClipCellContentOnResize="False" />
                <Selecting AllowRowSelect="True" />
              </ClientSettings>
              <MasterTableView AllowMultiColumnSorting="False" EnableNoRecordsTemplate="False" GridLines="None" DataKeyNames="ID" TableLayout="Fixed" ShowHeader="false">
                <Columns>
                  <telerik:GridBoundColumn DataField="ID" HeaderText="" UniqueName="ID" Display="false">
                    <HeaderStyle Width="0px" />
                  </telerik:GridBoundColumn>
                  <telerik:GridBoundColumn DataField="CarType" HeaderText="" UniqueName="CarType" Display="false">
                    <HeaderStyle Width="0px" />
                  </telerik:GridBoundColumn>
                  <telerik:GridBoundColumn DataField="Rate" HeaderText="" UniqueName="Rate" Display="false">
                    <HeaderStyle Width="0px" />
                  </telerik:GridBoundColumn>
                  <telerik:GridBoundColumn DataField="CurrencyCode" HeaderText="" UniqueName="CurrencyCode" Display="false">
                    <HeaderStyle Width="0px" />
                  </telerik:GridBoundColumn>
                  <telerik:GridBoundColumn DataField="Period" HeaderText="" UniqueName="Period" Display="false">
                    <HeaderStyle Width="0px" />
                  </telerik:GridBoundColumn>
                  <telerik:GridBoundColumn DataField="Total" HeaderText="" UniqueName="Total" Display="false">
                    <HeaderStyle Width="0px" />
                  </telerik:GridBoundColumn>
                  <telerik:GridCheckboxColumn DataField="HasInclusions" HeaderText="" UniqueName="HasInclusions" Display="false">
                    <HeaderStyle Width="0px" />
                  </telerik:GridCheckboxColumn>
                </Columns>
                <DetailItemTemplate>
                    <asp:Table ID="RateTable" runat="server" BorderWidth="0" Width="100%">
                        <asp:TableRow>
                            <asp:TableCell HorizontalAlign="Center" Width="70%" BorderColor="Transparent">
                               <asp:Label ID="lblCarType" runat="server"></asp:Label></asp:TableCell>
                           <asp:TableCell RowSpan="4" ID="tcbtnBook" HorizontalAlign="Center" VerticalAlign="Top" BorderColor="Transparent">
                               <asp:Button ID="btnBook" runat="server" CssClass="BtnStyle" Width="75px" Text="" CommandName="Book"></asp:Button>
                           </asp:TableCell>
                        </asp:TableRow>
                        <asp:TableRow>
                            <asp:TableCell CssClass="LabelHeading" HorizontalAlign="Center" Width="70%" BorderColor="Transparent">
                               $ <asp:Label ID="lblRate" runat="server"></asp:Label> <asp:Label ID="lblCurrencyCode" runat="server"></asp:Label> / <asp:Label ID="lblPeriod" runat="server"></asp:Label></asp:TableCell>
                        </asp:TableRow>
                        <asp:TableRow>
                            <asp:TableCell HorizontalAlign="Center" Width="70%" BorderColor="Transparent">
                               $ <asp:Label ID="lblTotal" runat="server"></asp:Label> <asp:Label ID="lblCurrencyCode2" runat="server"></asp:Label> <asp:Label ID="lblTotalText" runat="server"></asp:Label></asp:TableCell>
                        </asp:TableRow>
                        <asp:TableRow>
                            <asp:TableCell HorizontalAlign="Center" Width="70%" BorderColor="Transparent">
                               <asp:LinkButton ID="btnDetails" runat="server" Text="" Visible="false" CommandName="Details" /></asp:TableCell>
                        </asp:TableRow>
                    </asp:Table>
                </DetailItemTemplate>
              </MasterTableView>
            </telerik:RadGrid>


Javascript:
function btnBook_onclick(index, id) {
    var masterTable = $find("dgRates").get_masterTableView();
    masterTable.clearSelectedItems();
    masterTable.selectItem(index);
    return false;
}
Peter
Top achievements
Rank 1
 answered on 20 Nov 2014
1 answer
81 views
Hi

I am using Telerik UI for ASP.Net AJAX version 2014.3.1024.45, and specifically the SharePoint Editor Web Part and have come across a situation whereby I am not able to paste content from Visio when in IE, to RadEditor. It should be noted that I am able to paste other content, such as from Word, successfully.

I thought that this may be a general limitation, so I created a new web project in Visual Studio 2013, added the RadEditor control and when I ran the application, I was able to successfully paste the content from Visio to the RadEditor.

All of my previous tests were in IE 11, so I repeated the test in Chrome for the SharePoint site and it correctly pasted the content, suggesting that the problem is related to the SharePoint RadEditor web part in IE.  The results of my tests are as follows;

Paste to SharePoint RadEditor web part in IE doesn’t work
Paste to SharePoint RadEditor web part in Chrome does work
Paste to RadEditor in app I created in VS in IE does work
Paste to RadEditor in app I created in VS in Chrome does work

Has anyone else come across something similar and know how to fix it – if it is at all possible? The problem does appear to be directly related to the SharePoint web part version of the RadEditor, as it works fine in the app that I have created outside of SharePoint.

Any help or advice gratefully appreciated.

Thanks.

James.
Ianko
Telerik team
 answered on 20 Nov 2014
3 answers
226 views
Team,

we are using Telerik rich text editor, character count and word counts are displaying wrongly.

upon prefilling the data to the editor is adding few more character (Space/carriage return) at the end.

can we know how to address this?
Prakash
Top achievements
Rank 1
 answered on 20 Nov 2014
12 answers
171 views
is it possible to use the aggregates of grouped columns and other functionalities also in sharepoint 2010 environment.
The Columns definition as described in help is missing ?!

<telerik:GridBoundColumn Aggregate="Count" DataField="CustomerID" DataType="System.String"
  HeaderText="CustomerID" SortExpression="CustomerID" UniqueName="CustomerID">
</telerik:GridBoundColumn>


Here is the code of my webpart:
<WpNs1:TelerikSPRadGridWebPart runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId="{A4DEC18D-8081-41BC-95C2-3891DA62D7D2}" ><WebPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/WebPart/v2">
  <Title>Marketing Research</Title>
  <FrameType>None</FrameType>
  <Description>Telerik SPRadGrid Web Part</Description>
  <IsIncluded>true</IsIncluded>
  <ZoneID>g_35F88101A875412AA8912B7EAAF29F1A</ZoneID>
  <PartOrder>2</PartOrder><FrameState>Normal</FrameState><Height /><Width /><AllowRemove>false</AllowRemove><AllowZoneChange>false</AllowZoneChange><AllowMinimize>false</AllowMinimize><AllowConnect>true</AllowConnect><AllowEdit>false</AllowEdit><AllowHide>false</AllowHide><IsVisible>true</IsVisible><DetailLink /><HelpLink /><HelpMode>Modeless</HelpMode><Dir>Default</Dir><PartImageSmall /><MissingAssembly>Cannot import this Web Part.</MissingAssembly><PartImageLarge /><IsIncludedFilter /><ExportControlledProperties>true</ExportControlledProperties><ConnectionID>00000000-0000-0000-0000-000000000000</ConnectionID><ID>g_a4dec18d_8081_41bc_95c2_3891da62d7d2</ID><SqlDataStructure xmlns="Telerik.Ajax.SharePoint"><Connection><IntegratedSecurity>false</IntegratedSecurity></Connection><Columns /><DetailTables /><Relations /><PrimaryKeys /><EnableSorting>false</EnableSorting><EnablePaging>false</EnablePaging><EnableFiltering>false</EnableFiltering><EnableRowSelect>false</EnableRowSelect><EnableContextMenu>false</EnableContextMenu><EnableColumnReorder>false</EnableColumnReorder><AllowInsert>false</AllowInsert><AllowUpdate>false</AllowUpdate><AllowDelete>false</AllowDelete><AllowSelection>false</AllowSelection><AllowMultipleSelection>false</AllowMultipleSelection><PagerMode>NextPrev</PagerMode><Layout>Grid</Layout><InsertItemPosition>None</InsertItemPosition><Skin>Simple</Skin><UserInternalEditing>false</UserInternalEditing></SqlDataStructure><SPListDataStructure xmlns="Telerik.Ajax.SharePoint"><DetailTables /><Relations /><EnableSorting>false</EnableSorting><EnablePaging>false</EnablePaging><EnableFiltering>false</EnableFiltering><EnableRowSelect>false</EnableRowSelect><EnableContextMenu>false</EnableContextMenu><EnableColumnReorder>false</EnableColumnReorder><ShowGroupFooter>true</ShowGroupFooter><AllowInsert>false</AllowInsert><AllowUpdate>false</AllowUpdate><AllowDelete>false</AllowDelete><AllowSelection>false</AllowSelection><AllowMultipleSelection>false</AllowMultipleSelection><PagerMode>NextPrev</PagerMode><Layout>Grid</Layout><InsertItemPosition>None</InsertItemPosition><Skin>Simple</Skin><UserInternalEditing>false</UserInternalEditing></SPListDataStructure><ViewID xmlns="Telerik.Ajax.SharePoint">00000000-0000-0000-0000-000000000000</ViewID><ShowToolbar xmlns="Telerik.Ajax.SharePoint">false</ShowToolbar><EnableHeaderContextMenu xmlns="Telerik.Ajax.SharePoint">false</EnableHeaderContextMenu><EnableInserting xmlns="Telerik.Ajax.SharePoint">false</EnableInserting><EnableEditing xmlns="Telerik.Ajax.SharePoint">false</EnableEditing><EnableDeleting xmlns="Telerik.Ajax.SharePoint">false</EnableDeleting><Skin xmlns="Telerik.Ajax.SharePoint">Windows7</Skin><BindingMode xmlns="Telerik.Ajax.SharePoint">SPListSingle</BindingMode><ListID xmlns="Telerik.Ajax.SharePoint">94de5d0f-7f51-4c89-9e65-26c5074250bf</ListID></WebPart></WpNs1:TelerikSPRadGridWebPart>

Regards and help for support

Chris
Marin
Telerik team
 answered on 20 Nov 2014
1 answer
125 views
Hi, I want to apply filter on item template contains ternary how can do this.

 <telerik:GridTemplateColumn UniqueName="IsAverage"  HeaderText="Average/Sum" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"  AllowFiltering="false" >                                                                                                                               
       <ItemTemplate>  
      <asp:Label Id="active" runat="server" Text='<%# Convert.ToBoolean(Eval("IsAverage")) == true ? "Average" : "Sum" %>'></asp:Label>                                                     </ItemTemplate>                                                                  
            <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
       <ItemStyle HorizontalAlign="Left"></ItemStyle>
  </telerik:GridTemplateColumn>

please provide example or solution with source code.
Radoslav
Telerik team
 answered on 20 Nov 2014
3 answers
119 views
Hi, noob here so apologies in advance for any misconceptions but I downloaded the telerik demo and samples materials to a Win 8 with Visual Studio 2013 Professional installed in November 2014.  I've read/worked through the first half of the "UI for ASP.Net Ajax" pdf step by step tutorial as well as referenced/tried my hand at opening the CS solutions provided.  However, I'm not getting the sense this is the most productive strategy.  Yes, the pdf provides orientation but much of the specifics are -- I presume -- out of date for my setup.  Similarly the example solutions could imho use a "readme" page in the main directory detailing how to use them (including their age, the updates VS will require, how their file structure relates to the pdf etc).

My first question then is whether a better learning strategy or materials can be suggested.  (Fwiw I'd be willing to pay someone a moderate fee to be an answer resource that can speed my learning curve.) 

Secondly I have some database experience and wasted too much time researching MVC with its requisite EF/ORM "kludge" -- instead I want to normalize and tune a database then write stored procedures to connect with webform components (please advise of security or performance issues possibly resulting as appropriate).

Thanks in advance   
Marin Bratanov
Telerik team
 answered on 20 Nov 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?