Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
83 views
I have a two RadDateInput fields: one to contain the date itself, and the other to contain the time in military format.  I also have a "Now" button that I want to allow the user to push and populate the fields with the current date and time.  The date field works, but the time does not.  The time field gets '00:00'.  I am trying to do this client-side to avoid the round-trip.

The code in my ASPX page contains:

function setReqDateNow() {
    var d = new Date();
    var reqDate = $find("<%= reqDate.ClientID %>");
    var reqTime = $find("<%= reqTime.ClientID %>");
    reqDate.set_selectedDate(d);
    reqTime.set_selectedDate(d);
}
 
...
 
<telerik:RadDateInput ID="reqDate" runat="server" DisplayDateFormat="MM/dd/yyyy" Width="75" BackColor="#fbf5bb" />
<telerik:RadToolTip ID="tipReqDate" runat="server" HideEvent="LeaveTargetAndToolTip" TargetControlID="reqDate"
    Position="BottomRight" RelativeTo="Element" ShowEvent="OnMouseOver"
    Text="mm/dd/yyyy format less than or equal to today's date" />
   
<telerik:RadDateInput ID="reqTime" runat="server" DisplayDateFormat="HH:mm" Width="50" BackColor="#fbf5bb" />
<telerik:RadToolTip ID="tipReqTime" runat="server" HideEvent="LeaveTargetAndToolTip" TargetControlID="reqTime"
    Position="BottomRight" RelativeTo="Element" ShowEvent="OnMouseOver"
    Text="Enter time in hh:mm format" />
   
<asp:Button ID="btnNow" runat="server" Text="Now" OnClientClick="setReqDateNow();return false;" />

When the user clicks the button, it populates the date field, but it puts 00:00 in the time field.

Thank you in advance for your help!
Steve LaForge
Top achievements
Rank 1
 answered on 28 Oct 2011
4 answers
119 views
Hi, I'm having an annoying problem. When I select an item in the grid, the page automatically scrolls so the selected item is centered on the screen.
This behaviour is very annoying when I try to double-click an item 'cos the page scrolls on my first click and I end up doing my second click
somewhere else on the page.

Is there a way to disable this auto-scroll behavior?

Regards,
Santiago.
Diego
Top achievements
Rank 1
 answered on 28 Oct 2011
4 answers
824 views
i need to disable Gridbuttoncolumn where my value=0 if my value =1 Gridbuttoncolumn still show i try to use this code

For i = 0 To dt.Rows.Count - 1
          Dim dd As String = dt.Rows(i).Item("StatusCode").ToString
          If dd <> "0" Then
              RadGrid1.MasterTableView.Columns.FindByUniqueName("Accept").Visible = False
           End If
       Next

but if  dd <> 0  on the last of row button name "Accept" will be not show all of row
Luis
Top achievements
Rank 1
 answered on 28 Oct 2011
1 answer
73 views
Greetings,

I have a GridTemplateColumn on my grid :

<telerik:GridTemplateColumn UniqueName="TemplateEditColumn">
    <ItemTemplate>
        <asp:HyperLink ID="EditLink" runat="server" Text="Participants"></asp:HyperLink>
    </ItemTemplate>
</telerik:GridTemplateColumn>

When i click on it,the program goes here to send the ID of the row:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
 
    if (e.Item is GridDataItem)
    {
 
        HyperLink editLink = (HyperLink)e.Item.FindControl("EditLink");
        editLink.Attributes["href"] = "#";
        editLink.Attributes["onclick"] = String.Format("return ShowEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["idRDV"], e.Item.ItemIndex);
 
    }
 
 
}

BUT when i try to insert a new record on my grid, the program goes also here and create an ArgumentOutofRangeException

basically, it says : the index is out of range. Must be non-negative and less than the size of the collection. Parameter name: index


Can anyone help me ? thanks in advance
Tsvetina
Telerik team
 answered on 28 Oct 2011
4 answers
213 views
I have a radComboBox that I populate with data from a datatable. We do not allow custom text, so the first record is blank in case a user doesn't want to save any data from the comboBox. If the comboBox is loaded with items in the aspx page:
<telerik:RadComboBox ID="RadComboBox1" runat="server" AllowCustomText="false" MarkFirstMatch="true"
    Width="100px" DropDownWidth="150px" MaxHeight="350px" NoWrap="true" HighlightTemplatedItems="true"
    ExpandDirection="Down">
    <Items>
        <telerik:RadComboBoxItem Text=" " Value="" />
        <telerik:RadComboBoxItem Text="Female" Value="F" />
        <telerik:RadComboBoxItem Text="Male" Value="M" />
        <telerik:RadComboBoxItem Text="Unknown" Value="U" />
    </Items>
</telerik:RadComboBox>
the first highlighted row will have the same height as the rows with data.

If the comboBox is loaded from a datatable, the first row height is about 1/4 the height of the rows with data. See the attached jpg. Is there a way to make all the rows the same height when loaded from a datatable. I did try this with different skins and got the same effect.
<telerik:RadComboBox ID="RadComboBox1" runat="server" AllowCustomText="false" MarkFirstMatch="true"
    Width="100px" DropDownWidth="150px" MaxHeight="350px" NoWrap="true" HighlightTemplatedItems="true"
    ExpandDirection="Down">
    <ItemTemplate>
        <table style="width: 110px; text-align: left; font-size: 8pt" cellspacing="0" cellpadding="0">
            <tr>
                <td width="110px">
                    <%#DataBinder.Eval(Container.DataItem, "LookUp_List_Description")%>
                </td>
            </tr>
        </table>
    </ItemTemplate>
</telerik:RadComboBox>
The comboBox is actually part of an ascx control used for lookup items and is fully dynamic. All I have to do is set a property for the type of lookup data the box will self load.
  
I am using Telerik.Web.UI version 2011.2.712.35
Ivana
Telerik team
 answered on 28 Oct 2011
7 answers
180 views

I need to do something similar to that you have in this example

http://demos.telerik.com/aspnet-ajax/tooltip/examples/loadondemand/defaultcs.aspx but imagine that in the control that embedded in a tooltip is an update control and I’m changing product name, so after I finished updating my fields I need to refresh my parent page. How do I do that? I’m using the same control tree similar to what you have in your example.

  1. Have a parent page (user control)
  2. Have a telerik:RadListBox that is bound and on ItemDataBound I add TargetControls collection
  3. On OnAjaxUpdate I instantiate my “Update User Control”.  I have “Save” button on it so when action is taken in “Update” control I need to refresh my Parent page with new info
Marin Bratanov
Telerik team
 answered on 28 Oct 2011
7 answers
274 views
Hello,

I am unable to find an example that will do inline insert and update or form insert and update for radgrid.

I found an example http://demos.telerik.com/aspnet-ajax/grid/examples/client/insertupdatedelete/defaultcs.aspx
and implemented that feature and works fine with WCF. But what i really want it to do inline insert and update or
form insert and update from clientside.

Is there any example available or a blog entry for this?

Regards
Mac
Tsvetoslav
Telerik team
 answered on 28 Oct 2011
1 answer
85 views
How can I make my telerik:RadTicker control refresh data without having to reload the page every time there is a change to the underlying data?
Slav
Telerik team
 answered on 28 Oct 2011
3 answers
266 views
hi

I am using radtreeview with the following properties and settings but when i click on node "onnodeclick" event dosnot work.
the second problem is that the + in right of node does not work at all(expand), and also when i debug it doesn't go to nodeclick event.

     <telerik:RadTreeView ID="TreePicGroup" runat="server" DataFieldID="ID" DataFieldParentID="ParentID"
                            DataTextField="Title" CheckBoxes="true" OnNodeClick="TreePicGroup_NodeClick" OnNodeDrop="treeRole_NodeDrop"
                            EnableDragAndDrop="True" EnableEmbeddedSkins="True" Skin="Telerik"
                            dir="rtl" RegisterWithScriptManager="False" >
                        </telerik:RadTreeView>
-------------------------------------------------------------------------------------------------------------------------------------------------
C# Code

  
    protected void TreePicGroup_NodeClick(object sender, RadTreeNodeEventArgs e)
    {
        pnlMSG.Visible = false;
        pnlSetting.Visible = true;

        lblSubMenu.Text = e.Node.Text;

        if (e.Node.Text != "ريشه" && HidNewGroup.Value != "New")
        {

            DataTable dtGroup;

            CMS_PictureGallary ObjPicGroup = new CMS_PictureGallary();

            dtGroup = ObjPicGroup.GetGroup(Convert.ToInt32(cmbLibrary.SelectedValue), Convert.ToInt64(e.Node.Value));
            txtTitle.Text = dtGroup.Rows[0]["Title"].ToString();
            txtDes.Text = dtGroup.Rows[0]["Des"].ToString();
            txtDate.Value = ShamsiDate.get(dtGroup.Rows[0]["Created"].ToString(), 1);
            chkShowPic.Checked = Convert.ToBoolean(dtGroup.Rows[0]["PicPanel"]);
            if (dtGroup.Rows[0]["Link"].ToString().StartsWith("?PageID"))
            {
                CboLink.SelectedValue = "1";
                txtLinkID.Text = dtGroup.Rows[0]["Link"].ToString();
                TrLink.Visible = true;
            }
            if (e.Node.ParentNode == null)
                ChkReport.Enabled = false;
            else
            {
                ChkReport.Enabled = true;
                int Report = ObjPicGroup.Search_ReportGroup(Convert.ToInt32(cmbLibrary.SelectedValue), (dtGroup.Rows[0]["ParentID"]).ToString());
                if (Convert.ToInt32(e.Node.Value) == Report)
                    ChkReport.Checked = true;
                else
                    ChkReport.Checked = false;
            }
            //set Visible
            cboDisplay.SelectedValue = Convert.ToInt32(dtGroup.Rows[0]["checked_out"]).ToString();
            ImgPic.ImageUrl = "~/uploads/" + dtGroup.Rows[0]["BasesID"].ToString() + "/PictureGallary/Group/" + e.Node.Value.ToString() + ".jpg";


            BtnReg.Text = "ويرايش";
            pnlGroupName.Visible = true;

        }
        else
        {
            pnlGroupName.Visible = false;
            if (HidNewGroup.Value == "New")
            {
                txtTitle.Text = "";
                txtDate.Value = ShamsiDate.get(DateTime.Now.ToString(), 1);
            }
            else
                pnlSetting.Visible = false;
        }
    }
----------------------------------

Thanks NeDa
Plamen
Telerik team
 answered on 28 Oct 2011
3 answers
58 views
Plamen
Telerik team
 answered on 28 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?