Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
107 views
How to localize RadDatePicker button (Today, Ok, Cancel) ?
Pls see the red circle in the attached file.
Eyup
Telerik team
 answered on 14 Aug 2012
9 answers
575 views

I must be doing something wrong.  I have a RadComboBox and it is showing the first item in the list bound to it vs. EmptyMessage.  Any help would be appreciated.  In the below example, I want the drop down to first display "Choose an Organization"  Instead, it is displaying the DataTextField (first item in data set).   Thanks in advance.

.ASCX Control

<strong>Organization:</strong><br />
<telerik:RadComboBox runat="server" ID="OrganizationList" 
EmptyMessage="Choose an Organization" EnableLoadOnDemand="true"
HighlightTemplatedItems="true" Width="600px" BackColor="#FFFFCC" 
DataTextField="Name" DataValueField="ContactId" OnItemsRequested="RadComboBox_LoadOrganizations">
        <ItemTemplate>
            <table style="width: 550px;">
                <tr>
                    <td><%# DataBinder.Eval(Container.DataItem, "Name") %></td>
                </tr>
              
            </table>
        </ItemTemplate>   
</telerik:RadComboBox>

.ASCX.CS Code Behind
protected void RadComboBox_LoadOrganizations(object sender, RadComboBoxItemsRequestedEventArgs e)
{
    int userID;
    userID = Convert.ToInt32(Server.HtmlEncode(Request.QueryString["UID"]));
    OrgView.ContactLookup[] orglist = orgData.GetAssociatedContactsLookupList(userID);
    OrganizationList.DataSource = orglist;
    OrganizationList.DataBind();
}

Ivana
Telerik team
 answered on 14 Aug 2012
1 answer
102 views
Hi all,


My web page has got a asp:TextBox and a listview, initially the listview is not visisble.When user type a text inside the TextBox I want a listview bound with the database. Exactly my requirment is to bind list view depanding upon the value typed in the textbox.
My sqlquery to extarct the value fron the db is."SELECT patientOrg, surgeryDate FROM DetailsChart WHERE patientName ="text from textbox"

Reply as soon as possible.

Thanks,
Mkm. 
Princy
Top achievements
Rank 2
 answered on 14 Aug 2012
3 answers
72 views
I am trying to change the default HTML output of the table tool so that whenever it is used the HTML inserted has the width automatically set to 100% and the margin and padding set to 0. I've tried using "OnClientCommandExecuting" but I'm not sure I'm going down the right path. Can this be achieved?
William Hurst
Top achievements
Rank 1
 answered on 14 Aug 2012
1 answer
59 views
I have a large dataset that I would like to be able to group in order to show a "summary" view.  Because the dataset is very large, I have paging enabled.  

I'm having trouble showing multiple collapsed groups on one page.  Here is an example of one page: <groupbyproject.jpg >

I would like to see something like this: <groupbyproject_all.jpg>

Thank you

Eyup
Telerik team
 answered on 14 Aug 2012
1 answer
711 views
hello ... i'm using radtreeView and it's a wonderful control i have a small problem and i hope you can help me with it i've created a Next button and a search textbox the user enter the preferred search criteria in the textbox and hit Next. when he click on Next i search the treeView and find the first occurrence in the treeView nodes and make it selected and when he click Next again i want to find the next occurrence of the same node and make it selected how can i achieve this thank you :) i want it 2 be client side if possible
Peter
Telerik team
 answered on 14 Aug 2012
3 answers
67 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
240 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
109 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
351 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?