Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
931 views

Hi,

I am using raddatepicker for selecting the dates. my scenario when i select the startdate , on click of enddate raddatepicker, the start date value should be pre-populated. I am using javascript to achieve this function. But i am unable to achieve the same. Below is the code.

I am passing the clientId because the raddatepicker is in userControl and i am calling the javascript method in parent page.

Problem is when i am passing clientId it is always going as string.  Let me know if anything i need to do.

 <telerik:RadDatePicker ID="rdDPStartDate" runat="server" Height="20px" onclick=" def(this, 'acd' );"
                    Width="223px">
                </telerik:RadDatePicker>
                <br />
       
            <div id="divEndDatePicker" class="DivTxtBox">
                <telerik:RadDatePicker ID="rdDpEndDate" runat="server" value="Set Date"
                    onclick=" setdate(this,'<%=rdDPStartDate.ClientID %>');" Height="20px" Width="223px">
                </telerik:RadDatePicker>
               

function setdate( start,end) {debugger;
          dateVar = new Date();
         var sd =  $find('end');
         var startDate = sd.get_selectedDate();
         var endDate = $find(start.Id).set_selectedDate(startDate);
//          varDate = datePicker.get_selectedDate();
//          
//          endDatePicker.set_selectedDate(varDate);
      }
Andrey
Telerik team
 answered on 07 Mar 2013
1 answer
68 views
Hi,

I am using telerik radgrid in my application. The problem I am facing here is that the when I set the headerstyle and itemstyle width in percentage header table and the item table columns are not aligned .  I have set the mastetableview's tablelayout property to fixed and also. This issue does not occur when I set the width of  headerstyle and item style  in px. The grid ItemTable has a scrollbar and I think the scrollbar is creating an issue for this. Please help in this.


Thanks,
Shinu
Top achievements
Rank 2
 answered on 07 Mar 2013
3 answers
337 views
Hi folks,
Can anyone let me know if it is possible to add a custom close image button to the Radwindow and hide all other button control in titlebar?

Thanks,
Henry.
Princy
Top achievements
Rank 2
 answered on 07 Mar 2013
1 answer
58 views
Hi,

looks like the below link is moved or renamed...
http://demos.telerik.com/aspnet/prometheus/Window/Examples/CommunicationBetweenRadWindows/DefaultCS

kindly provide the current URL for the same...
Princy
Top achievements
Rank 2
 answered on 07 Mar 2013
2 answers
288 views
Hi,

I am attempting to extract the HTML markup from a RadGrid, but I am having a problem.  Specifically, when the

grd.RenderControl(htmlWriter)

 

line is executed, an error is being thrown stating that the GridLinkButtons must be placed within a form tag.  My goal is to extract the HTML markup of the header columns and grid data items only - if this approach won't work, then I will probably have to look into a technique that will iterate each row of the grid and manually write the HTML (I'd like to avoid this if at all possible).  Here is the code that I have at this point:

public static string ConvertRadGridToHTML(ref Telerik.Web.UI.RadGrid grd)
{
    var stringwriter = new StringWriter();
    var htmlWriter = new HtmlTextWriter(stringwriter);
    string result;
    try
        {
            htmlWriter.RenderBeginTag(HtmlTextWriterTag.Html);
            htmlWriter.RenderBeginTag(HtmlTextWriterTag.Body);
            grd.RenderControl(htmlWriter);
            htmlWriter.RenderEndTag();
            htmlWriter.RenderEndTag();
            htmlWriter.Flush();
            result = htmlWriter.ToString();
        }
    catch
        {
            result = String.Empty;
        }
    finally
        {
            htmlWriter.Close();
            stringwriter.Close();                   
        }
        return result;
}
Princy
Top achievements
Rank 2
 answered on 07 Mar 2013
1 answer
65 views
I have a radgrid with a column for comments.  Its purpose is for the user to explain why they made a change to that particular item. To enable that I have made it a template column and in the EditItemTemplate, I've added a required field validator.  So far so good.  However, the requirement means that EVERY time a change is made, a new comment is required.  As it is, when the user clicks the edit button, the text from the previous comment is shown in the textbox.  If the user clicks update, the required field validator sees that text and validates the field. 
That code looks like this

 

<telerik:GridTemplateColumn DataField="Comments" AllowFiltering="false" FilterControlAltText="Filter Comments column" HeaderText="Comments" SortExpression="Comments" UniqueName="Comments">

 

<EditItemTemplate>

 

<asp:TextBox ID="txtComments" runat="server" Text='<%# Bind("Comments")%>' TextMode="MultiLine"></asp:TextBox>

 

<asp:RequiredFieldValidator ID="rfvComments" ControlToValidate="txtComments" Display="Dynamic" runat="server" ErrorMessage="Please enter a reason for changing this budget item."></asp:RequiredFieldValidator>

 

</EditItemTemplate>

 

<ItemTemplate>

 

<asp:Label ID="CommentsLabel" runat="server" Text='<%# Eval("Comments") %>'></asp:Label>

 

</ItemTemplate>

 

</telerik:GridTemplateColumn>




I tried replacing the  Text='<%# Bind("Comments")%>'  with  Text='' but then the new text was not returned.  ( A trace showed that parameter value to be null).  I have tried to keep the application simple and so am not currently using any code-behind.  If possible, I'd like to avoid that.

So, I'm looking for some help in how to clear the textbox when the edit button is pushed so the required field validator will do its work, while still having the new comment included when the page is posted back.

I appreciate any help you can give.
Thanks
Rick

 

 

 



Jayesh Goyani
Top achievements
Rank 2
 answered on 07 Mar 2013
1 answer
180 views
I am using a RadWindow as a modal popup and can't seem to find a way to prevent the scroll bars from appearing on the window. If anyone know how I can eliminate the scroll bars from showing up on my popup please reply with your suggestions.

Thanks,

Jaime
Princy
Top achievements
Rank 2
 answered on 07 Mar 2013
1 answer
120 views
Hi,

I have a grid has <EditFormSettings EditFormType="Template" .
I have a linkbutton draft column in the grid and showing edit form once click on draft link button.

But its binding last row values always .I have written the code in the itemdatabound event.

for example I have 2 records in the grid and If i click on 1st record then it's always showing 2nd row in the edit form popup that mean my code calling twice at this scenario.

itemdatabound calling for every record and showing last record values in the popup.

this is my code :

If System.Web.HttpContext.Current.Session("state") IsNot Nothing Then
            If System.Web.HttpContext.Current.Session("state").ToString = "SaveAsDraft" Then
                If TypeOf e.Item Is GridDataItem Then
                    Dim item As GridDataItem = TryCast(e.Item, GridDataItem)
                    ViewState("EmailIdValue") = item("id").Text
                End If
                If TypeOf e.Item Is GridEditFormItem And e.Item.IsInEditMode Then
                    If e.Item.OwnerTableView.IsItemInserted Then
                        Dim record As New DataTable
                        If ViewState("EmailIdValue") <> "" Then
                            record = GetDataTable("select * from t_EmailFiling where id='" & ViewState("EmailIdValue") & "'")
                        End If
                        If record.Rows.Count > 0 Then
                            Dim insertItem As GridEditFormInsertItem = DirectCast(e.Item, GridEditFormInsertItem)
                            CType(insertItem.FindControl("Recipient"), RadTextBox).Text = record.Rows(0)("Recipient").ToString()
                            CType(insertItem.FindControl("RecipientCC"), RadTextBox).Text = record.Rows(0)("RecipientCC").ToString()
                            CType(insertItem.FindControl("RecipientBCC"), RadTextBox).Text = record.Rows(0)("RecipientBCC").ToString()
                            CType(insertItem.FindControl("Subject"), RadTextBox).Text = record.Rows(0)("Subject").ToString()
                            CType(insertItem.FindControl("Message"), RadEditor).Content = record.Rows(0)("Message").ToString()
                        End If
                    End If
                End If
            End If
            End If
 

I would like to show in the editform that exact row what i have clicked in the grid. Please help me on this..

Thanks in advance ..
Shinu
Top achievements
Rank 2
 answered on 07 Mar 2013
1 answer
85 views
I'm trying to use an ObjectDataSource bound to a RadGrid to perform automatic Select, Insert, Update and Delete.  The OnSelecting method of the ODS refers to a method that is a member of MyClass, and returns a List<MyClass>.  The OnUpdating method is also a member of that class and is annotated with [DataObjectMethod(DataObjectMethodType.Update, true)]

        [DataObjectMethod(DataObjectMethodType.Update, true)]
        public void updateMyClass(MyClass myClassToUpdate, string UserId)
        {
            BusinessLayer.updateClass(myClassToUpdate, UserId);
        }

The exception I'm getting indicates that the method should list the individual fields of the class. That's not how I'm used to doing this and some of my classes I'll be using have a large number of fields.  Is there a setting for RadGrid or something else I'm missing that would allow me to pass the class in directly?

Steve
Steven
Top achievements
Rank 1
 answered on 07 Mar 2013
2 answers
81 views
Hello!

I am in a tricky situation , some one please help!

I have a Rad Window which has content(images and video) and I have a link, when clicked opens dnnModal,

When the link is clicked, and if I decide not to do anything(close the modal), I can avoid refresh of the parent Radwindow by setting the showreturn(5th argument) of dnnModal value to false.

Now if I decide to do something, example change some text on dnnModal window and close, how can I reload/refresh my parent window(RadWindow) to load the updated content.

Any help is greatly appreciated!

Thanks in advance,
Sakshi
Sakshi
Top achievements
Rank 1
 answered on 06 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?