Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
260 views
I have a form I've created to map data from Excel into our SQL Server-based system.  The basic idea is that a user picks the Excel file to upload, then "maps" the data by selecting the database field then the corresponding Excel column.  Once the user has "mapped" a file, they can save that "mapping" for future use.

The data on the mapping screen consists of two columns - one an asp:Panel full of dynamically created RadTextBoxes representing the fields in the database (created from the DBSchema) and the other being a GridView of the "column headers" and the first row of data from the Excel file.  From there it's all point and click to map the data - Click on a database field then click on the Excel column. Javascript is used to populate the RadTextBox with the column information and to "remove" the row from the Excel GridView (so a column can only be mapped once).

When the user "saves" a mapping, the dynamically created RadTextBoxes are walked and rows are created in SQL Server using the name of the RadTextBox and part of the Text property.

All this works fine.

The problem I have is when the user tries to "load a mapping" that has previously been saved.  Using the routine that creates the list of RadTextBoxes, I populate the Text property with data from the DB (and set some CSS wrapping the "row").  This is where my problem lies.  I set the Text property, but the value is empty when the page is rendered.  I can set breakpoints in the code and "see" that the property is set to the proper value, but it still displays empty.

Futhermore - I can set the EmptyMessage property to the same value I'm attempting to place in the Text property and have that display. So something I'm doing is stomping on the Text property, but I just don't see it.  I've stepped line-by-line through the code and the values "hold" but just don't display - unless I take a long time stepping through the code, then it works .....

I'm not quite sure what's going on with this since I can get this to work by itself, just not in conjunction with the rest of the page.

I'm using RadControls for ASPNET AJAX Q1 2009

Here's the code for the function that creates the RadTextBoxes.  On a page by itself it works fine and with ASP:TextBox controls it works fine.  I know this probably isn't enough to go on, but there does seem to be a case when a dynamically created RadTextBox doesn't "hold" the .Text property :)

protected void FillFieldList(MappingType mtType, Guid? nguidFieldMappingID)  
{  
    DataTable dtLayout = Property.GetDBSchema();  
    RadTextBox rtxtNewTextBox;  
    FieldMappingItem fmiMappings = new FieldMappingItem();  
    StringBuilder sbControl;  
    string strMappedName = "";  
    bool bolMappedFound = false;  
 
    if ((mtType == MappingType.ReloadMapping) || (mtType == MappingType.LoadSavedMapping))  
    {  
        fmiMappings = new FieldMappingItem(nguidFieldMappingID);  
    }  
 
    foreach (DataRow drData in dtLayout.Rows)  
    {  
        if ((drData["DataTypeName"].ToString() != "uniqueidentifier") && (drData["ColumnName"].ToString() != "Created"))  
        {  
            strMappedName = string.Empty;  
            sbControl = new StringBuilder();  
            sbControl.Append("<div id=\"div");
            sbControl.Append(drData["ColumnName"].ToString());
            sbControl.Append("\" onclick=\"SelectRow('div");
            sbControl.Append(drData["ColumnName"].ToString());
            sbControl.Append("');\"");  
 
            foreach (FieldMappingDetailItem fmdiDetails in fmiMappings.Details)  
            {  
                if (fmdiDetails.FieldName == drData["ColumnName"].ToString())  
                {  
                    bolMappedFound = true;  
                    sbControl.Append(" class=\"MapFieldMapped\">");  
                    strMappedName = fmdiDetails.MappedName;  
                    break;  
                }  
            }  
 
            if (bolMappedFound)  
            {  
                bolMappedFound = false;  
            }  
            else 
            {  
                sbControl.Append(">");  
            }  
 
            this.pnlFields.Controls.Add(new LiteralControl(sbControl.ToString()));  
 
            rtxtNewTextBox = new RadTextBox();  
            rtxtNewTextBox.ID = "rtxt" + drData["ColumnName"].ToString();  
            rtxtNewTextBox.CssClass = "FormFieldMapping";  
            rtxtNewTextBox.Label = drData["ColumnName"].ToString();  
            rtxtNewTextBox.LabelCssClass = "FormLabel";  
            rtxtNewTextBox.EmptyMessage = strMappedName;  
            rtxtNewTextBox.Text = strMappedName;  
            this.pnlFields.Controls.Add(rtxtNewTextBox);  
              
            sbControl = new StringBuilder();  
            sbControl.Append("<input type=\"hidden\" id=\"hdn");
            sbControl.Append(drData["ColumnName"].ToString());
            sbControl.Append("\" value=\"");  
            sbControl.Append(rtxtNewTextBox.ClientID);  
            sbControl.Append("\" />");  
            this.pnlFields.Controls.Add(new LiteralControl(sbControl.ToString()));  
            this.pnlFields.Controls.Add(new LiteralControl("</div>"));  
        }  
    }  
}  
 
Ricardo
Top achievements
Rank 1
 answered on 29 Mar 2012
6 answers
93 views
Hi Telerik:

This is a question perplex me.
In RadGrid,Nest a RadChart,Of course ,that data bind to radGrid.
There are two kind of think. 
        First : Through data of  radGrid takes datasource to radChart. This think source think of silverlight.
        Second: Through keyColumn of  radGrid ,Execute StoredProcedure with parameter to bind radChart. Why needing execute StoredProcedure ,Because I must process some things. The SqlDataSource seem to can't to execute  StoredProcedure with parameter.

I try to two ways,but fail.I  distressed.
So I please admin help me trying to use second way. Give me some example.
The sourcecode here:


<telerik:RadGrid AutoGenerateColumns="False" ID="RadGridFHData"
                AllowFilteringByColumn="True" AllowPaging="True"
                AllowSorting="True" runat="server" ShowGroupPanel="true"
            onitemcommand="RadGridFHData_ItemCommand">
                <PagerStyle Mode="NextPrevAndNumeric" />
                <GroupingSettings CaseSensitive="false" />
                <MasterTableView TableLayout="Fixed" DataKeyNames="FHID" ClientDataKeyNames="FHID">
                    <Columns>
                        <telerik:GridBoundColumn HeaderText="FHID" DataField="FHID" UniqueName="FHID"
                            SortExpression="FHID" HeaderStyle-Width="100px" FilterControlWidth="100px"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />

                        <telerik:GridBoundColumn HeaderText="病人ID" DataField="PID" UniqueName="PID"
                            SortExpression="PID" HeaderStyle-Width="100px" FilterControlWidth="100px"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />

                        <telerik:GridBoundColumn HeaderText="病人姓名" DataField="PName" UniqueName="PName"
                            SortExpression="PName" HeaderStyle-Width="100px" FilterControlWidth="100px"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />

                        <telerik:GridNumericColumn  HeaderText="测量值" DataField="FHValue" UniqueName="FHValue"
                            SortExpression="FHValue" HeaderStyle-Width="100px" FilterControlWidth="140px"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />

                        <telerik:GridDateTimeColumn HeaderText="测量日期" DataField="ReceiveDate" UniqueName="ReceiveDate"
                            SortExpression="ReceiveDate" HeaderStyle-Width="100px" FilterControlWidth="140px"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />

                        <telerik:GridBoundColumn HeaderText="查看状态" DataField="isNew" UniqueName="isNew"
                            SortExpression="isNew" HeaderStyle-Width="100px" FilterControlWidth="140px"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />

                        <telerik:GridBoundColumn HeaderText="医生留言" DataField="Remark" UniqueName="Remark"
                            SortExpression="Remark" HeaderStyle-Width="100px" FilterControlWidth="140px"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />
                    </Columns>
                                        
                    <NestedViewSettings>
                        <ParentTableRelation>
                            <telerik:GridRelationFields DetailKeyField="FHID" MasterKeyField="FHID" />
                        </ParentTableRelation>
                    </NestedViewSettings>
                     <NestedViewTemplate >
                         <table>
                             <tr>
                                <td align="left" colspan="3">
                                    <telerik:RadChart ID="RadChartFH" runat="Server"
                                                      Width="495px" AutoLayout="true" Skin="Mac">
                                        <ClientSettings EnableZoom="false" ScrollMode="XOnly" XScale="4" />
                                        <Series>
                                            <telerik:ChartSeries Name="ChartFH" DataYColumn="FHValue" Type="Line">
                                                <Appearance FillStyle-MainColor="223, 87, 60">
                                                </Appearance>
                                            </telerik:ChartSeries>
                                        </Series>
                                        <Legend Visible="false"></Legend>
                                        <ChartTitle TextBlock-Text="Scrolling only (initial XScale applied)">
                                        </ChartTitle>
                                    </telerik:RadChart>

                                </td>
                             </tr>
                         </table>
                   </NestedViewTemplate>
                  
                </MasterTableView>
                <ClientSettings AllowDragToGroup="true" >
                    <Selecting AllowRowSelect="true" />
                    <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                </ClientSettings>
      </telerik:RadGrid>

      <asp:SqlDataSource ID="SqlDataSource1" CancelSelectOnNullParameter="false" runat="server" ConnectionString="<%$ appSettings:XCareSqlConn%>"
           ProviderName="System.Data.SqlClient" SelectCommandType="StoredProcedure" SelectCommand="ChartFHData">
          <SelectParameters>
               <asp:Parameter  Name="FHID" Type="String"/>
           </SelectParameters>          
          
      </asp:SqlDataSource>







     
Andrey
Telerik team
 answered on 29 Mar 2012
3 answers
164 views
Hi All,

       I have grid in PopupControlExtender and paging is not working for Next, Previous buttons. 
      I am using need datasource event also.Can you Please Help me to solve this issue.

Here is My code.

 

<asp:Panel ID="pnlSearch" runat="server" DefaultButton="ibtnSearch">
    <table cellpadding="0" cellspacing="0" class="search_restaurant_table">
        <tr>
            <td class="search_restaurant_table_right">
                 </td>
            <td class="search_restaurant_table_spacer">
                 </td>
            <td>
                <asp:HiddenField ID="hidResId" runat="server" />
                <asp:HiddenField ID="hidMessage" runat="server" Value="Search Restaurant (Name/Type/Category/Cuisine)." />
            </td>
        </tr>
        <tr>
            <td class="search_restaurant_table_right">
                <asp:Label ID="lblTitle" runat="server" SkinID="label_9_bold"
                    Text="Restaurant :" Width="170"></asp:Label>
            </td>
            <td class="search_restaurant_table_spacer">
                 </td>
            <td>
                <table cellpadding="0" cellspacing="0" class="search_restaurant_table">
                    <tr>
                        <td class="search_restaurant_table_inner">
                            <asp:TextBox ID="txtRestaurantSearch" runat="server" Width="400px" AutoComplete="Off" ></asp:TextBox>
                            <cc1:PopupControlExtender ID="txtRestaurantSearch_PopupControlExtender" runat="server" TargetControlID="txtRestaurantSearch"
                                PopupControlID="pnlRestaurant" Position="Bottom" OffsetY="0">
                            </cc1:PopupControlExtender>
                            <telerik:RadWindowManager ID="rwmResInfo" runat="server" Style="width: 750px; height: 350px"
                                OnClientShow="radResInfo_show" OnClientClose="radResInfo_close" Behavior="Default"
                                InitialBehavior="Default" EnableViewState="false" Modal="true" VisibleStatusbar="false">
                                <Windows>
                                    <telerik:RadWindow ID="rwdResInfo" runat="server" Skin="Office2007">
                                    </telerik:RadWindow>
                                </Windows>
                            </telerik:RadWindowManager>
                        </td>
                        <td>
                            <asp:ImageButton ID="ibtnSearch" runat="server" CausesValidation="False"
                                ImageUrl="~/Images/page/search.png" ToolTip="Search" />
                            <div style="position: fixed; left: 110%;">
                                <asp:Button ID="btnPostBack" runat="server" CausesValidation="false" Visible="true"
                                    Width="1" Height="1"/>
                            </div>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td class="search_restaurant_table_right">
                 </td>
            <td class="search_restaurant_table_spacer">
                 </td>
            <td align="left">
                <asp:Label ID="lblMessage" runat="server" SkinID="label_8" Text="Search Restaurant (Name/Type/Category/Cuisine)."></asp:Label>
                <asp:RequiredFieldValidator ID="rfvRestaurant" runat="server" ControlToValidate="txtRestaurantSearch"
                    Display="Dynamic" ErrorMessage="* Select Restaurant" Enabled="False"></asp:RequiredFieldValidator>
                <div style="position: absolute; left: 110%;">
                    <asp:Panel ID="pnlRestaurant" runat="server" BackColor="#E6F2E7" Width="670px" BorderWidth="1"
                        BorderStyle="NotSet" BorderColor="#999999">
                        <div style="width:100%; margin:0px auto; overflow-y:scroll;">
                            <table cellpadding="0" cellspacing="0" style="padding:5px; width:95%;">
                                <tr>
                                    <td style="background-color:#D1DEBE;" align="Left">
                                        <table cellpadding="0" cellspacing="0" class="search_restaurant_table">
                                            <tr>
                                                <td class="search_restaurant_table_search_more">
                                                    <asp:LinkButton ID="lbtnSearch" runat="server" CausesValidation="False"
                                                        SkinID="linkbutton_8" Text="Search more">
                                        </asp:LinkButton>
                                                    <asp:Label ID="Label2" runat="server" SkinID="label_8" Text="with filters.">
                                        </asp:Label>
                                                </td>
                                                <td>
                                                    <table cellpadding="0" cellspacing="0" class="search_restaurant_table">
                                                        <tr>
                                                            <td class="search_restaurant_table_sort">
                                                                <asp:Label ID="Label3" runat="server" SkinID="label_8" Text="Sortings :"></asp:Label>
                                                            </td>
                                                            <td class="search_restaurant_table_right">
                                                                 </td>
                                                            <td class="search_restaurant_table_sort_parameter">
                                                                <asp:DropDownList ID="cmbSort1" runat="server" SkinID="dropdownlist_8"
                                                                    Width="80px">
                                                                    <asp:ListItem Text="(None)" Value=""></asp:ListItem>
                                                                    <asp:ListItem Text="Name" Value="Name"></asp:ListItem>
                                                                    <asp:ListItem Text="Category" Value="Category"></asp:ListItem>
                                                                    <asp:ListItem Text="Cuisine" Value="Cuisine"></asp:ListItem>
                                                                    <asp:ListItem Text="Type" Value="Type"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </td>
                                                            <td class="search_restaurant_table_sort_value">
                                                                <asp:DropDownList ID="cmbSort1Value" runat="server" SkinID="dropdownlist_8"
                                                                    Width="50px">
                                                                    <asp:ListItem Text="Asc" Value="Asc"></asp:ListItem>
                                                                    <asp:ListItem Text="Desc" Value="Desc"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </td>
                                                            <td class="search_restaurant_table_sort_parameter">
                                                                <asp:DropDownList ID="cmbSort2" runat="server" SkinID="dropdownlist_8"
                                                                    Width="80px">
                                                                    <asp:ListItem Text="(None)" Value=""></asp:ListItem>
                                                                    <asp:ListItem Text="Name" Value="Name"></asp:ListItem>
                                                                    <asp:ListItem Text="Category" Value="Category"></asp:ListItem>
                                                                    <asp:ListItem Text="Cuisine" Value="Cuisine"></asp:ListItem>
                                                                    <asp:ListItem Text="Type" Value="Type"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </td>
                                                            <td class="search_restaurant_table_sort_value">
                                                                <asp:DropDownList ID="cmbSort2Value" runat="server" SkinID="dropdownlist_8"
                                                                    Width="50px">
                                                                    <asp:ListItem Text="Asc" Value="Asc"></asp:ListItem>
                                                                    <asp:ListItem Text="Desc" Value="Desc"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </td>
                                                            <td class="search_restaurant_table_sort_parameter">
                                                                <asp:DropDownList ID="cmbSort3" runat="server" SkinID="dropdownlist_8"
                                                                    Width="80px">
                                                                    <asp:ListItem Text="(None)" Value=""></asp:ListItem>
                                                                    <asp:ListItem Text="Name" Value="Name"></asp:ListItem>
                                                                    <asp:ListItem Text="Category" Value="Category"></asp:ListItem>
                                                                    <asp:ListItem Text="Cuisine" Value="Cuisine"></asp:ListItem>
                                                                    <asp:ListItem Text="Type" Value="Type"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </td>
                                                            <td class="search_restaurant_table_sort_value">
                                                                <asp:DropDownList ID="cmbSort3Value" runat="server" SkinID="dropdownlist_8"
                                                                    Width="50px">
                                                                    <asp:ListItem Text="Asc" Value="Asc"></asp:ListItem>
                                                                    <asp:ListItem Text="Desc" Value="Desc"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </td>
                                                            <td style="text-align: left">
                                                                <asp:LinkButton ID="btnOK" runat="server" CausesValidation="False"
                                                                    SkinID="linkbutton_8" Text="OK"></asp:LinkButton>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                                                                                                        
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <telerik:RadGrid ID="grdResult" runat="server" EnableEmbeddedSkins="False" EnableViewState="false" AllowMultiRowSelection="True"
                                            Skin="custom_econcierge" EnableTheming="False"
                                            AllowPaging="True" AllowSorting="true" GridLines="Horizontal"
                                            PageSize="2" Width="640px">
                                            <PagerStyle AlwaysVisible="True" />
                                            <ClientSettings EnablePostBackOnRowClick="True">
                                                <Selecting AllowRowSelect="True" />
                                            </ClientSettings>
                                            <mastertableview>
                                                <rowindicatorcolumn>
                                                    <HeaderStyle Width="20px" />
                                                </rowindicatorcolumn>
                                                <expandcollapsecolumn>
                                                    <HeaderStyle Width="20px" />
                                                </expandcollapsecolumn>
                                                <Columns>
                                                    <telerik:GridButtonColumn CommandName="View" Text="View"
                                                        UniqueName="View" ItemStyle-Width="30px" HeaderStyle-Width="30px" FooterStyle-Width="30px">
                                                        <ItemStyle BackColor="Lavender" ForeColor="Blue" />
                                                    </telerik:GridButtonColumn>
                                                </Columns>
                                            </mastertableview>
                                        </telerik:RadGrid>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </asp:Panel>
                </div>
            </td>
        </tr>
    </table>
 
</asp:Panel>

 

 

Thank you.
Antonio Stoilkov
Telerik team
 answered on 29 Mar 2012
5 answers
154 views
Please can any one there help out? i want to create or insert binaryimage into the database.
Emmanuel
Top achievements
Rank 1
 answered on 29 Mar 2012
3 answers
174 views
Hi,
I need to make hierarchical grid based on some condition.This means if there is no details,then there should not be (+) image in the grid.I need to hide expand image based on condition.Each master row i have the status of whether detail is there or not.
Princy
Top achievements
Rank 2
 answered on 29 Mar 2012
6 answers
707 views
I am switching over a gridview to a radgrid and ran into a hiccup, Gridview when a cell is blank actually puts in a &nbsp; so you have to check for this , apparently Radgrid works differently.  I am trying to find out if a cell is blank or not, if its blank I want to hide a button on the radgrid.
Protected Sub myRadGrid_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles myRadGrid.ItemDataBound
       If (TypeOf e.Item Is GridDataItem) Then
           Dim button As LinkButton = e.Item.FindControl("lnkPickUp")
           Dim text As String = e.Item.Cells(7).Text
           If text = Nothing Then
               button.Enabled = False
               button.Visible = False
           End If
       End If
   End Sub
Kevin
Top achievements
Rank 1
 answered on 29 Mar 2012
7 answers
354 views

Hi dude,
I have a RadGrid in Asp.net with three groups. I want to Have a checkbox on the last group header. I do not need to have checkbox in other group header. WHat should I do?

Tnx alot
Tsvetina
Telerik team
 answered on 29 Mar 2012
0 answers
72 views
Hi..
Anyone please...

We are using telerik rad menu control to list out rad menu items in silverlight project . Sometimes it's working well, but sometimes it's shows control error message.

In my project we have Rad treeview , if we select a Rad treeview item, it will open and the title of the treeview item should add in RadMenu items. If I mouseover on RadMenu it will show the menu items what are all added. And close the treeview item which is opened.  Then, again we are open the same treeview item.

Now, the title of treeview item added successfully in RadMenu items in code side using break points. But In design, If I mouseover on RadMenu, it's not show the RadMenu items what are all added. Instead It shows the control related error message box.

code for Add Menu item in RadMenu : Sample1.xaml.cs
**********************************************************************************************************************************************************************
 private RadMenuItem AddChildRadMenuItem(RadMenuItem item, string text)
        {
            if (item == null)
                return null;
            RadMenuItem child = new RadMenuItem();
            child.Click += (s, e) => MenuItemShowWindowClick(s, e);
            child.Header = text;

            foreach (RadMenuItem menuItem in item.Items)
                menuItem.IsChecked = false;
            item.Items.Add(child);
            child.IsChecked = true;
            return child;
        }

**********************************************************************************************************************************************************************

Code for remove menu item for radmenu : Sample1.xaml.cs

private void RemoveRadMenuItem(string name)
        {
            WindowsMenuItem.IsEnabled = true;
            App.checkwindow = false;
            for (int i = 0; i < WindowsMenuItem.Items.Count; i++)
            {
                RadMenuItem menuItem = (RadMenuItem)WindowsMenuItem.Items[i];
                string menuHeader = (menuItem.Header == null) ? "" : menuItem.Header.ToString();
                if (string.Compare(menuHeader, name, CultureInfo.CurrentCulture, CompareOptions.Ordinal) == 0)
                {
                    WindowsMenuItem.Items.Remove(menuItem);
                    menuItem.Click -= (s, e) => MenuItemShowWindowClick(s, e);
                }
            }
            if (WindowsMenuItem.Items.Count == 0)
            {
                WindowsMenuItem.IsEnabled = false;
                App.checkwindow = true;
                return;
            }
            if (((WindowsMenuItem.Items[WindowsMenuItem.Items.Count - 1]) as RadMenuItem).IsCheckable)
                ((WindowsMenuItem.Items[WindowsMenuItem.Items.Count - 1]) as RadMenuItem).IsChecked = true;
        }

***********************************************************************************************************************************************************************
code for select item of RadMenu: Sample1.xaml.cs

  private void MenuItemShowWindowClick(object sender, RoutedEventArgs e)
        {
            RadMenuItem radMenuItem = (sender as RadMenuItem);
            if (radMenuItem == null)
                throw new InvalidOperationException("Object menu raise exception in method Click.");
            foreach (RadDocumentPane documentPane in DiagramPaneGroup.Items)
            {
                if (documentPane.Header is TabItemHeader)
                {
                    TabItemHeader tabItemHeader = (TabItemHeader)documentPane.Header;
                    string documentName = tabItemHeader.Model.Text;
                    string Title_ = "";

                    if (documentName.Contains("*"))
                    {
                        string[] header = documentName.TrimStart().TrimEnd().Trim().Split('*');

                        Title_ = header[0].Trim().TrimStart().TrimEnd().ToString();

                        if (string.Compare(Title_, radMenuItem.Header.ToString(), CultureInfo.CurrentCulture, CompareOptions.Ordinal) == 0)
                        {
                            DiagramPaneGroup.SelectedItem = documentPane;
                        }

                    }
                    else if (string.Compare(documentName, radMenuItem.Header.ToString(), CultureInfo.CurrentCulture, CompareOptions.Ordinal) == 0)
                    {
                        DiagramPaneGroup.SelectedItem = documentPane;
                    }
                }
            }
        }
***********************************************************************************************************************************************************************
Design code of silverlight Sample1.xaml file

<telerikNavigation:RadMenu x:Name="MainMenu" VerticalAlignment="Top" ClickToOpen="False" Grid.Row="0" >
        ..............
                ..................

                         <telerikNavigation:RadMenuItem Header="Window" x:Name="WindowsMenuItem"></telerikNavigation:RadMenuItem>
                ...................
       .................

</telerikNavigation:RadMenu>

************************************************************************************************************************************************************************

We are using Q3 2010 version of Radcontrols. please try to send the solutions as soon as possible..

For clear information please see the below images ..

Thanks,
PRABAKARAN G.

KARAN
Top achievements
Rank 1
 asked on 29 Mar 2012
9 answers
238 views

Following is the javascript code where I am adding few items in existing rad context menu i.e. RadMenu1. There are few items already in it and I am adding few more items dynamically in javascript

function ContextMenuOpen(sender, args) 
{
   
var menu = $find("m_c_RadMenu1");
   
if (IsMobileBrowser() == false)
   
{
       
var evt = args.get_domEvent();
   
}
    menu
.trackChanges();
   
var items = menu._getAllItems()
    menu
.get_items().clear();

   
//menu.commitChanges();
   
AddItem("Visit & View Details", "a");

   
if (selectedRow.findElement("lblTask") != null) {
       
var tasklist = selectedRow.findElement("lblTask").defaultValue;
       
var taskArray = tasklist.split(',');

       
for (i = 0; i < taskArray.length; i++) {
           
if (typeof (taskArray[i].split('~')[1]) == 'undefined') break;
           
AddItem("Perform " + taskArray[i].split('~')[1], taskArray[i].split('~')[0]);
       
}
       
//rb.AddItem(selectedRow.findElement("lblTask").innerText,4)
   
}
   
AddItem("Log an Incident", "b");
   
if (rb.isLocationSelected == false) {

   
AddItem("Log a Discrepancy", "c");
}


function AddItem(text, value) {
   
var menu = rb.GetMenu();
   
var item = rb.GetContextMenuItem(text);
   
if (item != null) return false;
   
var menuItem = new Telerik.Web.UI.RadMenuItem();
    menuItem
.set_text(text);
    menuItem
.set_value(value)
    menu
.trackChanges();
    menu
.get_items().add(menuItem);
    menu
.commitChanges();
   
return true;
}

Everything goes well , but the newly added context menu shows transparent background on rightside , I found it is filling the background only at the area where text is present , on empty area at rightside it is transparent (see attached image )

see the transparent background, right side of the items

do anybody know how to remove this transparent background?

Anjani
Top achievements
Rank 1
 answered on 29 Mar 2012
1 answer
131 views
Hai,

I have a hiddenfield in the item template of a Radcombo. I have to take the value of hiddenfield in the SelectedIndexChanged event of radcombo. I used the following method as per your website refernece for radcombo. This code was working fine. But one day it started not working, showing null reference exception in finding the hiddenfield. I didn't change anything.

protected

 

void rcbTruck_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)

 


{

RadComboBox

 

combo = (RadComboBox)sender;

 

 

RadComboBoxItem item = (RadComboBoxItem)combo.SelectedItem;

 


hidDailyOrderDetailId2.Value = ((

HiddenField)item.FindControl("hidDailyOrderDetailId1")).Value;

 


}

aspx

<

 

asp:HiddenField ID="hidDailyOrderDetailId2" runat="server" />

 



<

 

telerik:RadComboBox ID="rcbTruck" runat="server" DropDownWidth="250px" Width="250px"

 

 

ShowToggleImage="true" Height="140px" AllowCustomText="True" MarkFirstMatch="False"

 

 

HighlightTemplatedItems="True" TabIndex="2" EmptyMessage="--Select--" AutoPostBack="true"

 

 

EnableLoadOnDemand="True" Skin="Web20" ToolTip="Please Select truck" MaxHeight="250px"

 

 

OnItemsRequested="rcbTruck_ItemsRequested" OnSelectedIndexChanged="rcbTruck_SelectedIndexChanged">

 

 

<ItemTemplate>

 

 

<input id="hidScheduledStartTime" type="hidden" runat="server" value='<%#DataBinder.Eval(Container.DataItem,"ScheduledTime") %>' />

 

 

<asp:Label ID="lblVehicleName" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"VehicleName") %>'></asp:Label>

 

 

<asp:HiddenField ID="hidDailyOrderDetailId1" runat="server" Value='<%#DataBinder.Eval(Container.DataItem,"Daily_Order_Detail_Id") %>' />

 

 

</ItemTemplate>

 

 

</telerik:RadComboBox>

 

Ivana
Telerik team
 answered on 29 Mar 2012
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?