Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
97 views
Hi,

I have the following grid, all the  GridBoundColumn's populate when the grid is loaded but the radcombobox does not. How can I get it to display the current value?  Does anyone have an example of a radgrid where one of the columns is a drop down or combo box?

 


Thanks for any help in advance,

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadGrid1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                <telerik:AjaxUpdatedControl ControlID="Label1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadGrid 
    ID="RadGrid1" 
    DataSourceID="SessionDataSource1" 
    OnItemDataBound = "RadGrid1_ItemDataBound"
    Width="97%"
    ShowStatusBar="True" 
    AllowSorting="True" 
    PageSize="7" 
    GridLines="None" 
    AllowPaging="True"
    runat="server" 
    AllowAutomaticUpdates="True" 
    AutoGenerateColumns="False">
    <MasterTableView 
                TableLayout="Fixed" 
                DataKeyNames="checklistNo" 
                EditMode="InPlace" 
                DataSourceID="SessionDataSource1">
      <Columns>
        <telerik:GridBoundColumn UniqueName="CategoryID" DataField="CategoryID" HeaderText="CategoryID" ReadOnly="True" >
            <HeaderStyle Width="10%" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn UniqueName="checklistNo" DataField="checklistNo" HeaderText="checklistNo"  Display="False" ReadOnly="True" >
            <HeaderStyle Width="25%" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn UniqueName="Related_item_type_label" DataField="Related_item_type_label" HeaderText="Question"  ReadOnly="True">
            <HeaderStyle Width="30%" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn UniqueName="Service_impact_category" DataField="Service_impact_category" ReadOnly="True" HeaderText="Service Impact" >
            <HeaderStyle Width="10%" />
        </telerik:GridBoundColumn>
         <telerik:GridTemplateColumn UniqueName="Inspection Result" DataField="INSPECTION_RESULT" HeaderText="Inspection Result">
            <HeaderStyle Width="17%" />   
            <ItemStyle Width="17%" />
            <EditItemTemplate>
               <telerik:RadTextBox Visible="False" AutoPostBack="true" ID="lblInspectionResult" runat="server"  Text='<%#Eval("INSPECTION_RESULT")%>'>
               </telerik:RadTextBox>
               <telerik:RadComboBox visible="True" ID="cbInspectionResult" AppendDataBoundItems="true" runat="server"  DataTextField="INSPECTION_RESULT" DataValueField="INSPECTION_RESULT">
               </telerik:RadComboBox>
            </EditItemTemplate>
         </telerik:GridTemplateColumn>
        <telerik:GridBoundColumn UniqueName="Inspection_Fault" DataField="Inspection_Fault" HeaderText="Fault" >
            <HeaderStyle Width="10%" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn UniqueName="inspection_comment" DataField="inspection_comment" HeaderText="Comments" >
            <HeaderStyle Width="10%" />
        </telerik:GridBoundColumn>
      </Columns>
    </MasterTableView>
    <ClientSettings>
        <ClientEvents 
              
            OnRowClick="RowClick"
            OnRowDblClick="RowDblClick"
              
            OnGridCreated="GridCreated" 
            OnCommand="GridCommand" />
    </ClientSettings>
</telerik:RadGrid>

,
Judy

Veli
Telerik team
 answered on 16 Aug 2010
8 answers
226 views
Hi guys!
We've been using Telerik.Web.UI v.2010.1.309.35 in our project, and recently have switched to v.2010.1.519.35 . Since that I've discovered that ListView doesn't seem to process <%%> tags correctly during binding. For instance, here's the EditItemTemplate that I have:
<EditItemTemplate>
 <tr>
  <td style="vertical-align:top">
   <rlt:TextBox ID="txtDurationMonth" runat="server" 
                ValueType="Integer"
                Width="50px" 
                Text='<%#Eval("DurationMonth") %>'
   ></rlt:TextBox>
   <asp:RangeValidator runat="server" 
                ControlToValidate="txtDurationMonth" 
                ErrorMessage="Integer value required" 
                MinimumValue="0" 
                MaximumValue="<%#int.MaxValue %>" 
                Type="Integer" 
                SetFocusOnError="true">
   </asp:RangeValidator>
  </td>
  <td style="vertical-align:top">
   <rlt:LinkButton ID="lbSave" runat="server" 
          CommandName="<%#RadListView.UpdateCommandName%>" CommandArgument='<%#Eval("Id") %>'>Save</rlt:LinkButton>
  </td>
 </tr>
</EditItemTemplate>
When I switch into Edit mode, I started getting an exception that it cannot parse '' (empty string) for MaximumValue of rangevalidator. I removed that validator at all and it switched fine, but CommandName of lbSave was always empty. Also, ListView has DataKeyNames="Id" However, if I try to get an ID in ListView ItemCommand handler like this:

((

RadListViewDataItem)e.ListViewItem).GetDataKeyValue("Id")

I get "index was out of range" exception. So I had to switch back to v.2010.1.309.35.  And now it works as it should, but that version has an issue with RadEditor, which is being stretched in some occasions.
So, is it some bug or do I miss something? Thanx in advance!

 

Neha
Top achievements
Rank 1
 answered on 16 Aug 2010
1 answer
101 views
I've got a Masterpage with an Ajaxmanager & loading panel on & 2 content panels. Content1 is a menu and Content2 is the actual aspx pages for the application where 100% of the application is loaded. On the screens there are save & cancel buttons with code behind procedures. I want to be able to show the loading panel when clicking save or cancel or even when an aspx page is loading.

Is this achievable and how?
Pavlina
Telerik team
 answered on 16 Aug 2010
1 answer
163 views
Hi Telerik Team,

The issue is my group headers are not coming while exporting since I am writing the following code:
if (e.Item is GridGroupHeaderItem)
{
(e.Item
as GridGroupHeaderItem).DataCell.Visible = false;
e.Item.PreRender +=
new EventHandler(Item_PreRender);
}
which is hiding the GroupHeaders DataCell since I need to customize the header as demonstrated in the following link
http://www.telerik.com/help/aspnet-ajax/aligning_items_in_groupheader2.html

Now,Please let me know with (e.Item as GridGroupHeaderItem).DataCell.Visible = false;
 and creating my own Table cells for the group header how can I bring the group header while exporting to excel?

I think export to excel takes group headers from Datacell only it does not identify anything else.Since I am adding table cells manually in the header it is not getting those.Please let me know how to resolve this issue?
Regards,
Shubh
Daniel
Telerik team
 answered on 16 Aug 2010
1 answer
199 views
Using jQuery to track changes on a form automatically sets the dirty flag for all controls at the form level, but controls (TextBox, DropDownList) inside a Grid edit row are not captured.  We are using the $(":input").change() method to capture changes in input controls.  Is there any automated way to capture the controls inside the Grid edit row?
Veli
Telerik team
 answered on 16 Aug 2010
7 answers
265 views
I currently am trying to perform a rebind of the Grid through AJAX whenever a node on a RadTreeView control is clicked.  The new data is successfully rebound, but for some reason the ability after rebinding I loose the ability to select items inside the grid.

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <ClientEvents />
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="rtFiles" EventName="OnNodeClick">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="grdFiles" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
  
    </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadSplitter ID="Splitter" Width="100%" runat="server">
    <telerik:RadPane ID="Pane1" runat="server">
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
        </telerik:RadAjaxLoadingPanel>
        <telerik:RadTreeView ID="rtFiles" runat="server"
            EnableAjaxSkinRendering="true"
            AllowNodeEditing="false"
            OnClientContextMenuItemClicking="rtFiles_onClientContextMenuItemClicking"
            oncontextmenuitemclick="rtFiles_ContextMenuItemClick" 
            onnodeedit="rtFiles_NodeEdit"
            OnNodeClick="rtFiles_NodeClick"
            >
            <ContextMenus>
                <telerik:RadTreeViewContextMenu ID="fileContextMenu">
                    <Items>
                        <telerik:RadMenuItem Text="Rename" Value="rename" PostBack="false"></telerik:RadMenuItem>
                        <telerik:RadMenuItem Text="Delete" Value="delete"></telerik:RadMenuItem>
                    </Items>
                </telerik:RadTreeViewContextMenu>
                <telerik:RadTreeViewContextMenu ID="albumContextMenu">
                    <Items>
                        <telerik:RadMenuItem Text="New Album" Value="newAlbum"></telerik:RadMenuItem>
                        <telerik:RadMenuItem Text="Upload File" Value="uploadFile"></telerik:RadMenuItem>
                        <telerik:RadMenuItem Text="Rename" Value="rename" PostBack="false"></telerik:RadMenuItem>
                        <telerik:RadMenuItem Text="Delete" Value="delete"></telerik:RadMenuItem>
                    </Items>
                </telerik:RadTreeViewContextMenu>
            </ContextMenus>
        </telerik:RadTreeView>
    </telerik:RadPane>
    <telerik:RadSplitBar ID="Split1" CollapseMode="Backward" runat="server" />
    <telerik:RadPane ID="Pane2" runat="server">
        <telerik:RadGrid ID="grdFiles" Width="100%" runat="server" AllowMultiRowSelection="true"
            onneeddatasource="grdFiles_NeedDataSource" 
            OnItemDataBound="grdFiles_ItemDataBound" >
            <SelectedItemStyle BackColor="Red" />
            <MasterTableView ShowHeader="true" UseAllDataFields="false" AutoGenerateColumns="false" RetrieveAllDataFields="false">
                <Columns>
                    <telerik:GridTemplateColumn HeaderText="File Name" >
                        <HeaderStyle Width="20px" />
                        <ItemTemplate>
                            <img src="/internetsite/Images/Icons/<%# Convert.ToBoolean(Convert.ToString(DataBinder.Eval(Container.DataItem, "Title")).Contains("."))? Convert.ToString(DataBinder.Eval(Container.DataItem, "Title")).Substring(Convert.ToString(DataBinder.Eval(Container.DataItem, "Title")).LastIndexOf(".") + 1) + ".gif" : "folder.gif" %>" /> <%# DataBinder.Eval(Container.DataItem, "Title") %>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
            </MasterTableView>
            <ClientSettings EnableRowHoverStyle="true">
                <Selecting AllowRowSelect="true" />
            </ClientSettings>
        </telerik:RadGrid>
    </telerik:RadPane>
</telerik:RadSplitter>

protected void grdFiles_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
   {
       string strValue;
       if (rtFiles.SelectedNode == null)
       {
           strValue = rtFiles.Nodes[0].Value;
       }
       else
       {
           strValue = rtFiles.SelectedNode.Value;
       }
       reloadDataSource_grdFiles(int.Parse(strValue.Substring(strValue.IndexOf("_") + 1)));
   }
protected void reloadDataSource_grdFiles(int intId)
   {
       grdFiles.MasterTableView.DataKeyNames = new string[] { "Id", "Title" };
       grdFiles.DataSource = myDataSource(intID);
   }
Pavlina
Telerik team
 answered on 16 Aug 2010
3 answers
286 views
Hi guys,

I am trying to do some logic when a new value is selected from the combobox.

I hooked up a callback function to the OnClientSelectedIndexChanged event. When I select a new element the event fires and when I click anywhere else ( the Combobox will lose focus) the event will fire again.

How can I overcome this?
Kalina
Telerik team
 answered on 16 Aug 2010
1 answer
86 views
I'm having this problem: 

http://www.technullogy.net/index.php/2010/03/05/internet-explorer-limits-css-and-script-resources-to-30/

To duplicate it, try adding one of each Telerik control to a page, then open the page in IE and see if all them appear correctly.  I have a page that has several different Telerik controls (RadAjax, RadTooltip, RadTabStrip, RadDate and Time Pickers, RadEditor, etc).  If I count all of the WebResource.axd references that IE 8 is making, it's over 30.  If I remove a couple Telerik controls, then the remaining controls get their style back.

They all appear perfect in Firefox 3.6.8, Chrome and Safari, so I know it's an IE 8 issue.  Is Telerik aware of this?  Is there any way around this?
Kamen Bundev
Telerik team
 answered on 16 Aug 2010
1 answer
113 views
Hi,

I have a self-referencing hierachical radGrid.  I am loading data thru the NeedDataSource event handler.  When I have 3 levels of hierarchy, the gridInstance.MasterTableView.DetailTables.count shows 1 , MasterTableViewDetailTables[0].DetaitTables.count is 1, so far so good. Now when I look at the last (the lowest level) GridTableView, its DetaitTables.Count is also 1 whereas this GridTableView does not have any children.  What am I missing? Is the DetailTables count always 1 when using Sel-Referencing Hierarcy? even for the GridTableView which has no chidren? Using RadControls for Ajax 2010_1_519 and Framework 3.5.

Thanks in advance for your help.

Veli
Telerik team
 answered on 16 Aug 2010
5 answers
188 views
Hi

how I can Hide Expand/Collpase button in code behind for some selected nodes?

Kiran
Nikolay Tsenkov
Telerik team
 answered on 16 Aug 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?