Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
55 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
268 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
55 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
164 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
112 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
81 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
65 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
2 answers
303 views
I would like the async upload to automatically postback after I select a file.

Is that possible?
Gerry
Top achievements
Rank 1
 answered on 06 Mar 2013
1 answer
54 views
Hi there,

We are using the editor to save HTML content to a database.

For some reason, the editor sometimes adds a HTML body tag to the content.

For example, the body tag was added to a simple HTML list we had:

<body class="RadEditorOverrides" contenteditable="true">
        <ul>
            <ul>
                <ul>
                    <p>&nbsp;</p>
                </ul>
            </ul>
        </ul>
    </body>

The content filter I have set is: 

ContentFilters="RemoveScripts,FixUlBoldItalic,IECleanAnchors,MozEmStrong,ConvertFontToSpan,ConvertToXhtml,IndentHTMLContent,ConvertCharactersToEntities,FixEnclosingP"

Would anyone be able to offer some advice on how this problem can be resolved?

 

 

Rumen
Telerik team
 answered on 06 Mar 2013
3 answers
315 views
Is there a way to hide the tooltip when you click on something else on the page?  I saw thread with suggestions to add an onclick event to the form or the body, but then the tooltip goes away even if you click on the tooltip itself.

Thanks,
Rimma
Marin Bratanov
Telerik team
 answered on 06 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?