Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
99 views
Hi

I dont know If this has been asked before. Did not see the same occurance.

I have a RadGrid that is populated with the NeedDataSource property which gets a list of Items from the Database. These records are all Identical at first except for there ID.

The Grid works with Item GridTemplateColumns and GridBoundColumns.
Most of the Columns have Dropdownboxes for editing.
One of the dropdownboxes calls a Method from Serverside to determine if Input validation on another control must take place.

Here is the problem All the records work perfectly eccept for the 2nd record.
When ever I change the value I can no longer Change the field that is being validated and no postbacks can be preformed because of the validator.

Any Advice wood be great or a posible cause for why only the 2nd record has this problem.

Below is the Grid
<telerik:RadGrid Visible="false" ID="rgBusValidators" runat="server" AutoGenerateEditColumn="True" 
          AlternatingItemStyle-BackColor="white" GridLines="None" 
          GroupingEnabled="False" Width="100%" Height="500px"
          AutoGenerateColumns="False" 
          onneeddatasource="rgBusValidators_NeedDataSource" 
          onupdatecommand="rgBusValidators_UpdateCommand" 
    oneditcommand="rgBusValidators_EditCommand" 
    onitemcreated="rgBusValidators_ItemCreated" >
          <AlternatingItemStyle BackColor="White" />
          <MasterTableView Caption="Bus Daily Report" 
              DataKeyNames="BusNumber,Depot,Operations,ValNum,ValOp,ValFault,AllocNow,AllocDay1,AllocDay2,ValStat,ServiceNumber" 
              ShowFooter="true">
              <Columns>
                      <telerik:GridBoundColumn AllowFiltering="False" AllowSorting="False" 
                      DataField="BusDailyReportID" HeaderText="BusDailyReportID" 
                      ReadOnly="true" UniqueName="BusDailyReportID" Visible="True">                      
                  </telerik:GridBoundColumn>
                      <telerik:GridBoundColumn AllowFiltering="False" AllowSorting="False" 
                      DataField="BusNumber" HeaderText="Bus Number" 
                      ReadOnly="true" UniqueName="BusNumber" Visible="true">                      
                  </telerik:GridBoundColumn>
  
                      <telerik:GridTemplateColumn AllowFiltering="False" HeaderText="Depot reporting to" UniqueName="Depot" >
                      <ItemTemplate>
                          <asp:Label ID="lblDepot" runat="server" Text='<%# Eval("Depot") %>'></asp:Label>
                      </ItemTemplate>
                      <EditItemTemplate>
                        <telerik:RadComboBox ID="Depot" runat="server"
                                AppendDataBoundItems="False"
                                SelectedValue='<%# Bind("Depot") %>'
                                DataTextField="Depot" 
                                DataValueField="Depot"
                                Width="160pt">  
                                                                
                                <Items>
                                <telerik:RadComboBoxItem Text="Midrand Depot" Value="Midrand Depot" />
                                <telerik:RadComboBoxItem Text="Pretoria Depot" Value="Pretoria Depot" />
                                </Items>
                          </telerik:RadComboBox>
                            
                      </EditItemTemplate>
                      </telerik:GridTemplateColumn>
                    
                      <telerik:GridTemplateColumn AllowFiltering="False" HeaderText="In Operations" UniqueName="Operations" >
                      <ItemTemplate>
                          <asp:Label ID="lblOperations" runat="server" Text='<%# Eval("Operations") %>'></asp:Label>
                      </ItemTemplate>
                      <EditItemTemplate>
                          <telerik:RadComboBox ID="Operations" runat="server"
                                AppendDataBoundItems="false"
                                SelectedValue='<%# Bind("Operations") %>'
                                DataTextField="Operations" 
                                DataValueField="Operations"
                                Width="160pt"
                                OnSelectedIndexChanged="Operations_SelectedIndexChanged"
                                AutoPostBack="True">                                
                                <Items>
                                <telerik:RadComboBoxItem Text="Operations" Value="Operations" />
                                <telerik:RadComboBoxItem Text="Repairs" Value="Repairs" />
                                <telerik:RadComboBoxItem Text="Service" Value="Service" />
                                </Items>
                          </telerik:RadComboBox>
                      </EditItemTemplate>
                      </telerik:GridTemplateColumn>
  
                      <telerik:GridTemplateColumn AllowFiltering="False" HeaderText="Validator Number" UniqueName="ValNum" >
                      <ItemTemplate>
                          <asp:Label ID="lblValNum" runat="server" Text='<%# Eval("ValNum") %>'></asp:Label>
                      </ItemTemplate>
                      <EditItemTemplate>
                          <telerik:RadComboBox ID="ValNum" runat="server"
                                AppendDataBoundItems="true"
                                SelectedValue='<%# Bind("ValNum") %>'
                                DataSourceID="ValidatorNumbers"
                                DataTextField="ValNum" 
                                DataValueField="ValNum"
                                Width="160pt">
                          </telerik:RadComboBox>
                      </EditItemTemplate>
                      </telerik:GridTemplateColumn>
  
                      <telerik:GridTemplateColumn AllowFiltering="False" HeaderText="Validator Operational" UniqueName="ValOp" >
                      <ItemTemplate>
                          <asp:Label ID="lblValOp" runat="server" Text='<%# Eval("ValOP") %>'></asp:Label>
                      </ItemTemplate>
                      <EditItemTemplate>
                          <telerik:RadComboBox ID="ValOp" runat="server"
                                AppendDataBoundItems="False"
                                SelectedValue='<%# Bind("ValOp") %>'
                                DataTextField="ValOp" 
                                DataValueField="ValOp"
                                AutoPostBack="true"
                                OnSelectedIndexChanged="ValOp_SelectedIndexChanged"
                                Width="160pt">                                
                                <Items>
                                <telerik:RadComboBoxItem Text="Operational" Value="Operational" />
                                <telerik:RadComboBoxItem Text="Faulty" Value="Faulty" />
                                <telerik:RadComboBoxItem Text="Not in Operations" Value="Not in Operations" />
                                </Items>
                          </telerik:RadComboBox>
                      </EditItemTemplate>
                      </telerik:GridTemplateColumn>
  
                      <telerik:GridTemplateColumn AllowFiltering="False" HeaderText="Validator Fault Type" UniqueName="ValFault" >
                      <ItemTemplate>
                          <asp:Label ID="lblValFault" runat="server" Text='<%# Eval("ValFault") %>'></asp:Label>
                      </ItemTemplate>
                      <EditItemTemplate>
                          <telerik:RadComboBox ID="ValFault" runat="server"
                                AppendDataBoundItems="False"
                                SelectedValue='<%# Bind("ValFault") %>'
                                DataTextField="ValFault" 
                                DataValueField="ValFault"
                                Width="160pt">                                
                                <Items>
                                <telerik:RadComboBoxItem Text="Not Applicable" Value="Not Applicable" />
                                <telerik:RadComboBoxItem Text="Validator freeze and can not scan CSC" Value="Validator freeze and can not scan CSC" />
                                <telerik:RadComboBoxItem Text="Validator reading ‘out of service’ on display screen" Value="Validator reading ‘out of service’ on display screen" />
                                <telerik:RadComboBoxItem Text="Validator Completely Off(not switching on)" Value="Validator Completely Off(not switching on)" />
                                <telerik:RadComboBoxItem Text="Validator reset lock broken" Value="Validator reset lock broken" />
                                <telerik:RadComboBoxItem Text="Validator screen not working (but still able to scan CSC)" Value="Validator screen not working (but still able to scan CSC)" />
                                </Items>
                          </telerik:RadComboBox>
                      </EditItemTemplate>
                      </telerik:GridTemplateColumn>
  
                      <telerik:GridTemplateColumn AllowFiltering="False" HeaderText="Allocation for the day" UniqueName="AllocNow" >
                      <ItemTemplate>
                          <asp:Label ID="lblAllocNow" runat="server" Text='<%# Eval("AllocNow") %>'></asp:Label>
                      </ItemTemplate>
                      <EditItemTemplate>
                          <telerik:RadComboBox ID="AllocNow" runat="server"
                                AppendDataBoundItems="true"
                                SelectedValue='<%# Bind("AllocNow") %>'
                                DataSourceID="dsStations"
                                DataTextField="Description" DataValueField="Description"
                                Width="160pt"> 
                                <Items>
                                <telerik:RadComboBoxItem Text="Midrand Depot" Value="Midrand Depot" />
                                <telerik:RadComboBoxItem Text="Pretoria Depot" Value="Pretoria Depot" />
                                </Items>
                          </telerik:RadComboBox>
  
                      </EditItemTemplate>
                      </telerik:GridTemplateColumn>
  
                      <telerik:GridTemplateColumn AllowFiltering="False" HeaderText="Allocation Day -1" UniqueName="AllocDay1" >
                      <ItemTemplate>
                          <asp:Label ID="lblAllocDay1" runat="server" Text='<%# Eval("AllocDay1") %>'></asp:Label>
                      </ItemTemplate>
                      <EditItemTemplate>
                          <asp:Label ID="AllocDay1" runat="server" Text='<%# Eval("AllocDay1") %>'></asp:Label>
                      </EditItemTemplate>
                      </telerik:GridTemplateColumn>
  
                      <telerik:GridTemplateColumn AllowFiltering="False" HeaderText="Allocation Day -2" UniqueName="AllocDay2" >
                      <ItemTemplate>
                          <asp:Label ID="lblAllocDay2" runat="server" Text='<%# Eval("AllocDay2") %>'></asp:Label>
                      </ItemTemplate>
                      <EditItemTemplate>
                          <asp:Label ID="AllocDay2" runat="server" Text='<%# Eval("AllocDay2") %>'></asp:Label>
                      </EditItemTemplate>
                      </telerik:GridTemplateColumn>
  
                      <telerik:GridTemplateColumn AllowFiltering="False" HeaderText="Validator Equipment Status" UniqueName="ValStat" >
                      <ItemTemplate>
                          <asp:Label ID="lblValStat" runat="server" Text='<%# Eval("ValStat") %>'></asp:Label>
                      </ItemTemplate>
                      <EditItemTemplate>
                          <telerik:RadComboBox ID="ValStat" runat="server"
                                AppendDataBoundItems="False"
                                SelectedValue='<%# Bind("ValStat") %>'
                                DataTextField="ValStat" 
                                DataValueField="ValStat"
                                Width="160pt">                                
                                <Items>
                                <telerik:RadComboBoxItem Text="Green" Value="Green" />
                                <telerik:RadComboBoxItem Text="Orange" Value="Orange" />
                                <telerik:RadComboBoxItem Text="Red" Value="Red" />
                                <telerik:RadComboBoxItem Text="Black" Value="Black" />
                                </Items>
                          </telerik:RadComboBox>
                      </EditItemTemplate>
                      </telerik:GridTemplateColumn>
  
                      <telerik:GridTemplateColumn AllowFiltering="False" HeaderText="Service Request Number" UniqueName="ServiceNumber" >
                      <ItemTemplate>
                          <asp:Label ID="lblServiceNumber" runat="server" Text='<%# Eval("ServiceNumber") %>'></asp:Label>
                      </ItemTemplate>
                      <EditItemTemplate>
                          <telerik:RadTextBox ID="ServiceNumber" Text='<%# Eval("ServiceNumber") %>' Runat="server" MaxLength="10"  >
                          </telerik:RadTextBox>   
                              <asp:RequiredFieldValidator ID="SerNumValidator" runat="server"
                              ErrorMessage="*" ControlToValidate="ValOp"></asp:RequiredFieldValidator>
                          <asp:RegularExpressionValidator ID="exValidator" runat="server" ErrorMessage="* Service Number Is Not Complete"
                           ControlToValidate="ServiceNumber" ValidationExpression=".{10}.*"></asp:RegularExpressionValidator
                            
                          </EditItemTemplate>
                            
                      </telerik:GridTemplateColumn>
              </Columns>
          </MasterTableView>
      </telerik:RadGrid>

Below is the NeedDatasource and OnSelectedChange events
protected void rgBusValidators_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            rgBusValidators.DataSource = BusList;
        }
  
protected void ValOp_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
        {
            try
            {
                GridEditableItem gRow = ((sender as RadComboBox).NamingContainer as GridEditableItem);
                RequiredFieldValidator snreq = ((RequiredFieldValidator)gRow["ServiceNumber"].FindControl("SerNumValidator"));
                if (e.Text == "Faulty")
                {
                    RadTextBox sntxt = ((RadTextBox)gRow["ServiceNumber"].FindControl("ServiceNumber"));
                    snreq.ControlToValidate = sntxt.ID;
                    snreq.IsValid = false;
                }
                else
                {
                    RadComboBox item = (RadComboBox)(sender);
                    snreq.ControlToValidate = item.ID;
                    snreq.IsValid = true;
                }
                  
            }
            catch (Exception ex)
            {
                lblError.Text = string.Format("Error: {0}", ex.Message);
                Log.Write(string.Format("Error Loading Data : {0}", ex.ToString()), Log.Category.IncidentManagementWeb, System.Diagnostics.TraceEventType.Error);
            }
        }

Please I need this urgantly
Marin
Telerik team
 answered on 14 Aug 2012
1 answer
275 views
Hi all,


I have got a RadButton in which i  want to change the color after the click event. After the first button click,  the button shoud be in a disabled state, so that it wont allow the another click.

<telerik:RadButton ID="RadButton1" runat="server"  onclick="RadButton1_Click">
</telerik:RadButton>

Please provide a solution as soon as possible.

Thanks,
Mkm.
Princy
Top achievements
Rank 2
 answered on 14 Aug 2012
2 answers
151 views
Hello,

I sucessfully added a radtooltip to a RadList control by using the ItemDataBound event using this code in the page:

    <telerik:RadToolTipManager ID="radToolTipManager1" runat="server" HideEvent="LeaveTargetAndToolTip"
    Width="250" Height="100" RelativeTo="Element" Position="MiddleRight" ShowDelay="500" >
    <WebServiceSettings Method="GetToolTipData" Path="~/Services/ToolTipWebService.asmx" />
    </telerik:RadToolTipManager>


And this in the code behind
 void RadListBoxSource_ItemDataBound(object sender, RadListBoxItemEventArgs e)
{
    if (e.Item is RadListBoxItem)
        {
            this.radToolTipManager1.TargetControls.Add(e.Item.ClientID, (e.Item as RadListBoxItem).Value, true);
        } 
}
The value is an ID that can be used to return a list from the webservice (in this case a list of Departments the hovered over person works for).

I tried to adapt this code for a RadComboBox on the same page, but no ToolTip is shown.

void ddPerson_ItemDataBound(object sender, RadComboBoxItemEventArgs e)
{
   if (e.Item is RadComboBoxItem)
   {
      this.radToolTipManager1.TargetControls.Add(e.Item.ClientID, (e.Item as RadComboBoxItem).Value, true);
   }
}


Is there a step that I am missing? The ClientID for the item when I add a breakpoint is something like "i0" which doesn't seem long enough.

Thank you for your help

Paul Herzberg
Paul Herzberg
Top achievements
Rank 1
 answered on 14 Aug 2012
1 answer
392 views
hi ,
I'm using Pager Template like you use in this link :
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/pagertemplate/defaultcs.aspx

but I just want to Set the previous button Disable when the Current Page Index is 1 and set Next Button disable when the Current Page Index is the last page . Last and First Button too .
thanks a lot .
Shinu
Top achievements
Rank 2
 answered on 14 Aug 2012
1 answer
119 views
Hello,
How can I place the upper value into the center of the green bar and same issue for the red bar ,On client side?
Giuseppe
Telerik team
 answered on 14 Aug 2012
1 answer
62 views
Hi,

We are running into a repeatable issue wherein Chrome and only Chrome dies with the following error "Uncaught SyntaxError: Unexpected Token. The error seems to be random. It absolutely kills everything and you need to do a complete reload of the screen.

Sometimes associated with a RadComboBox, other times, the RadProgress area. In googling this, there were suggestions regarding eliminating possible hidden garbage characters in the .aspx. 

In VS 2008, we copied out of VS into notepad and back in and also tried the Advanced - > Delete Horizontal White space option in VS 2008, but the problem persists. It presents itself in complex layouts where a RadMenu, ComboBox, Grid, MultiPage, Editor and Tab interface are provided. The screen in question does not use RadAjaxManager.

Any thoughts on how to diagnose and resolve this would be most welcome. This does not occur in Firefox or IE 9. 
Marin
Telerik team
 answered on 14 Aug 2012
17 answers
738 views
Hi,

For one of my project, i wans to use a MVC architecture for my program, so I checked what you've got for libraries for ASP, and I see you have an ASP.Net MVC and an Ajax version.

So, my questions:
  • Does Telerik ASP.NET MVC brings something to the "MVC" part? Or is it only user controls that we can use when we have a MVC application?
  • Is it possible to use your ASP.NET Ajax components with an ASP.NET MVC(with and without Telerik for ASP.NET MVC)?

Thank you for your help

Mk
Top achievements
Rank 1
 answered on 14 Aug 2012
1 answer
101 views
Hi,

I was wondering if it would be possible to create a grid and use ajax to manipulate data inside.

I have a RadGrid that is generated dynamically on server side. When it is generate, i use only JS events and functions to manipulate my page. But i don't know how to do this :

I want the content of the grid, by a click on an ASP button, launch a method that will just convert the content of the cell ( of type "x/y")
on percent values ( performing the operation (x*y / 100)). Is it possible to do this without refreshing the all page and just call a method ? Maybe using an AjaxManager and AjaxLoadingPanel ?

Thanks,
Maxime.
Kostadin
Telerik team
 answered on 14 Aug 2012
1 answer
103 views
Hi,

This is Rathan, I am using radmenu control in my project , In some pages when i postback the form the menu control is not workig properly(means it is showing same page not  allowing to click other tab).please let me know.


Thank you.
Rathan Kumar.K
Dhaval
Top achievements
Rank 1
 answered on 14 Aug 2012
0 answers
117 views
Hi,

I do have one RadCombobox and one Radgrid in my page separately. Depends upon the combo box selection the radgrid record will change. It is working fine now. But if I click the Insert option in radgrid, it show the input text fields and all other control, in that time I changed the combo box, the event is not get firing. May I know why? But the selection changed event firing, when I am in the editable mode in the radgrid.
Ananth
Top achievements
Rank 1
 asked on 14 Aug 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?