Telerik Forums
UI for ASP.NET AJAX Forum
11 answers
505 views
Hi,
In one of a form in our application we have a rad combo which updates itself with data everytime we change some parameters in form. We are using a webservice to get the list of  RadComboItemData and bind on the client side.

When we bind whats happening is that the last selected text still remains visible even if its not in the new list. We have a required field validator for the list. If I manually do select on the first item (First item displays a message that an item must be selected) of the new list using comboItem.Select() it launches validation and dispalys our required field validator that an item must be selected.
 
Is there a proper way of doing it so that new list populates itself without any garbage left over from the last binded data?

My second question is can we do validation on value of the selected item instead of text?

Thanks in advance for your help.

Best regards,
Khurram

Client side binding function

function bindCombo(combo,result){     
            
        var items = combo.get_items();  
        items.clear();  
        for(var i=0;i< result.length;i++){  
            var comboItem = new Telerik.Web.UI.RadComboBoxItem();  
            comboItem.set_text(result[i].Text);  
            comboItem.set_value(result[i].Value);  
            items.add(comboItem);  
            if (i == 0) {  
                comboItem.select();  
            }  
        }        
 

 

Anshuman
Top achievements
Rank 1
 answered on 19 May 2014
1 answer
85 views
When you select a file to upload first attach only one photo-Loading and the progress is not displayed. So when you select the file, close the window and back to the normal upload. If you select a file, then upload again reloading the phenomenon of the show will be repeated only. I would like to know why it does this??
Shinu
Top achievements
Rank 2
 answered on 19 May 2014
5 answers
178 views
Hi
I'm trying to drop a listbox row into a full grid.
The grid have 10 row and there is no extra space into the grid where dropped my listbox row. I thought the event had to be fired even if I dropped the row on a grid row but nothing happens.

Thanks
Shinu
Top achievements
Rank 2
 answered on 19 May 2014
1 answer
471 views
       
Hello, I want to make some rows selected from code-behind according to values from database
 
Client Side  
 <telerik:RadGrid ID="Grid" runat="server" AllowPaging="True" 
                          PageSize="5"     Width="100%"    OnPageIndexChanged="GridCourse_PageIndexChanged"
                          OnPreRender="Grid_PreRender"
                            GridLines="None" Skin="Vista" AllowMultiRowSelection="True" >
                            <MasterTableView DataKeyNames="CHOOSE"   >
                            <Columns>
                                <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn"  ></telerik:GridClientSelectColumn>                               
                             </Columns>
                            </MasterTableView>
                             
                            <ClientSettings EnableRowHoverStyle="true"  >
                                <Selecting AllowRowSelect="True"  />
                            </ClientSettings>
                        </telerik:RadGrid>    

Code-behind
Here is what I'm doing with no success....
protected void Grid_PreRender(object sender, EventArgs e)
        {
                 if (!IsPostBack)
                {
                    foreach (GridDataItem item in GridCourse.MasterTableView.Items)
                    {
                        if (item.GetDataKeyValue("CHOOSE").ToString().ToUpper() == "Yes".ToUpper())
                        {
                            item.Selected = true;
                        }
                    }
                }
      
        } 
Princy
Top achievements
Rank 2
 answered on 19 May 2014
3 answers
422 views
Hello,
see picture below,

i have 4 GridClientSelectColumn check box in radgrid ,
What i selected that only select but full row selected ,AllowMultiRowSelection= true

Thanks,
Mohamed.
PPRINC
Top achievements
Rank 1
 answered on 18 May 2014
1 answer
71 views
Is it possible to switch the view on the Scheduler so that the time is along the top with the days down the side? If it is could you tie this switch to a button control?
Boyan Dimitrov
Telerik team
 answered on 18 May 2014
4 answers
822 views
Hi

I want to display a column while adding a new record and normal display (ie.. in grid) but want to hide just in edit mode. Please let me know how can i achieve that both while using template columns and grid bound columns. Please respond to me ASAP.



Thanks,
Deepika
Princy
Top achievements
Rank 2
 answered on 17 May 2014
1 answer
182 views
I have create a table in the GroupHeaderTemplate.

<GroupHeaderTemplate>
                <table style="padding: 0px; margin: 0px; width: 100%; border-collapse: collapse;" id="tbl_GroupHeader">
                    <tr>
                        <td style="width: 10px; text-align: center;">
                              
                        </td>
                        <td style="width: 40px; text-align: center;">
                            <asp:Label runat="server" ID="Label1" Text="Account"></asp:Label>
                        </td>
                        <td style="text-align: center;">
                            <asp:Label runat="server" ID="Label2" Text="Description"></asp:Label>
                        </td>
                        <td style="width: 60px; text-align: center;">
                            <asp:Label runat="server" ID="Label3" Text="Date"></asp:Label>
                        </td>
                        <td style="width: 60px; text-align: center;">
                            <asp:Label runat="server" ID="Label4" Text="Entity ID"></asp:Label>
                        </td>
                        <td style="width: 150px; text-align: center;">
                            <asp:Label runat="server" ID="Label5" Text="MemberName"></asp:Label>
                        </td>
                        <td style="width: 70px; text-align: center;">
                            <asp:Label runat="server" ID="Label6" Text="Debit"></asp:Label>
                        </td>
                        <td style="width: 70px; text-align: center;">
                            <asp:Label runat="server" ID="Label7" Text="Credit"></asp:Label>
                        </td>
                    </tr>
                </table>
            </GroupHeaderTemplate>


I would like to access the table to hide it if the groupd is collapsed like:


Protected Sub rgd_JournalEntries_ItemCommand(sender As Object, e As Telerik.Web.UI.GridCommandEventArgs) Handles rgd_JournalEntries.ItemCommand
     If e.CommandName = "ExpandCollapse" Then
         If e.Item.Expanded Then
             For Each item As GridGroupHeaderItem In rgd_JournalEntries.MasterTableView.GetItems(GridItemType.GroupHeader)
                 TryCast(item.FindControl("tbl_GroupHeader"), Table).Visible = True
             Next
         Else
             For Each item As GridGroupHeaderItem In rgd_JournalEntries.MasterTableView.GetItems(GridItemType.GroupHeader)
                 TryCast(item.FindControl("tbl_GroupHeader"), Table).Visible = False
            Next
         End If
     End If
 
End Sub


Or just hide the GroupHeaderTemplate itself if the group is collapsed

Thank you for any help.

Princy
Top achievements
Rank 2
 answered on 17 May 2014
9 answers
952 views
I customized the page sized in paging drop down in code behind.

when the user change the paging size to 100 (or lower) it's working.
but when user change the paging size to 200 (or higher) and then try to press on next or different page size nothing happen. the big page size cause the paging mechanism to stuck until i refresh the page.

partial code:

grid.aspx.cs

  protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        //change paging combo value
        if (e.Item is GridPagerItem)
        {
            var dropDown = (RadComboBox)e.Item.FindControl("PageSizeComboBox");
            var totalCount = ((GridPagerItem)e.Item).Paging.DataSourceCount;
            var sizes = new Dictionary<string, string>()
            {
                {"10", "10"},
                {"20", "20"},
                {"50", "50"}
            };
            if (totalCount > 100)
            {
                sizes.Add("100", "100");
            }
            if (totalCount > 200)
            {
                sizes.Add("200", "200");
            }
            if (totalCount > 500)
            {
                sizes.Add("500", "500");
            }

            dropDown.Items.Clear();
            foreach (var size in sizes)
            {
                var cboItem = new RadComboBoxItem() { Text = size.Key, Value = size.Value };
                cboItem.Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID);
                dropDown.Items.Add(cboItem);
            }
            dropDown.FindItemByValue(e.Item.OwnerTableView.PageSize.ToString()).Selected = true;
        }


    }

grid.aspx
            <telerik:RadGrid ID="RadGrid1" runat="server"
                AllowSorting="false"
                MasterTableView-AllowMultiColumnSorting="true"
                AutoGenerateColumns="False" GridLines="None"
                AllowPaging="true" PageSize="50"
                Width="100%"
                OnNeedDataSource="RadGrid1_NeedDataSource"
                CellSpacing="0"
                OnItemDataBound="RadGrid1_ItemDataBound"
                OnPageIndexChanged="RadGrid1_PageIndexChanged"
                OnPreRender="RadGrid1_PreRender"
                OnItemCreated ="RadGrid1_ItemCreated"
                >
              
                <MasterTableView CommandItemDisplay="Top"
                    DataKeyNames="CycleCountDetailID, CycleCountID, ProductID"
                    ClientDataKeyNames="CycleCountDetailID, CycleCountID, ProductID"
                    >
                    <PagerStyle AlwaysVisible="true" Mode="NextPrevAndNumeric" />


Princy
Top achievements
Rank 2
 answered on 17 May 2014
1 answer
131 views
Good afternoon,
Inside RadPanelBar I have button which is redirect to another page:

<asp:Panel ID="Panel1" runat="server">
<telerik:RadPanelBar runat="server" ID="infoPanel" Width="98%" ExpandMode="MultipleExpandedItems" BorderWidth="1px" Skin="Telerik" >

<Items>
<telerik:RadPanelItem Expanded="true" Text="EMPLOYEE PERSONAL INFORMATION" runat="server" Selected="true" Font-Bold="true" Font-Size="13" Font-Names="Verdana">
<Items>
<telerik:RadPanelItem Value="employeeInfo" runat="server" Height="75">
<ItemTemplate>
<div id="formDiv" style="position:relative; left :0px;">
<asp:Button ID="ReqFormButton" Width="215px" CssClass="button" runat="server"
Text="New Shortage Area Request Form" onclick="ReqFormButton_Click" />

</div>
</ItemTemplate>
</telerik:RadPanelItem>
</Items>
</telerik:RadPanelItem>
</Items>
</telerik:RadPanelBar>
</asp:Panel>
When I had old computer Windows XP I had no problem to redirect but when I received a new machine with Windows 7 operating system and try to redirect to the page I am getting javascript error:
Line: 6
Error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '�'.

Please help me.
thanks so much.
Princy
Top achievements
Rank 2
 answered on 17 May 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?