Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
146 views
I am populating a grid from a datatable. I have to populate the columns from a database table to allow dynamic changing of fields and names:


                                foreach (DataRowView drv in dt.DefaultView)
                                {
                                    GridBoundColumn boundColumn;
                                    boundColumn = new GridBoundColumn();
                                    boundColumn.DataField = drv["DATA_FIELD"].ToString();
                                    boundColumn.UniqueName = drv["DATA_FIELD"].ToString();
                                    string x = L10N.Term(Context.Application, "test", drv["HEADER_TEXT"].ToString());
                                   
                                    boundColumn.HeaderText = L10n.Term(x);
                                    RadGrid1.MasterTableView.Columns.Add(boundColumn);


                                   
                                }

Even though I have told it what columns I want it to have it populates all the columns from the SQL search string. which has "Select * from "

Am I missing something?
Michael
Top achievements
Rank 1
 answered on 01 Nov 2011
3 answers
102 views
Here's my big problem

I paste this msword content to radeditor

Test de formulaire

Avec du rouge

Du bleu

Et du vert

User highlight Test de formulaire and click custom button with this code :

var selection = String(editor.getSelectionHtml());

                //selection = selection.replace("<q>", "");
                //selection = selection.replace("</q>", "");
                //selection = selection.replace("<Q>", "");
                //selection = selection.replace("</Q>", "");

                //Remove all custom tags before insert new custom tags
                var html = editor.get_html(false);
                html = html.replace("<q>", "");
                html = html.replace("</q>", "");
                html = html.replace("<Q>", "");
                html = html.replace("</Q>", "");

                var newhtml = html.replace(selectedText, '<q>' + selectedText + '</q>');
                //var newhtml = html.replace(selection, '<q>' + selection + '</q>');
                editor.set_html(newhtml);

                //Set schedule text
                var txtScheduleText = $find("<%=txtScheduleText.ClientID%>");
                txtScheduleText.set_mode(4);
                txtScheduleText.set_html(selection);
                txtScheduleText.set_mode(4);

This code must replace selectedhtml text like this : <FONT size=3 face=calibri>Ceci est un test</FONT>  by <q><FONT size=3 face=calibri>Ceci est un test</FONT></q>

The problem is that when i call var newhtml = html.replace(selection, '<q>' + selection + '</q>'); selection not exist in html because html look like this with msword special tag :

<FONT face=georgia>

<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3 face=calibri>Ceci est un test<?xml:namespace prefix = o /><o:p></o:p></FONT></P>

<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT color=#ff0000 size=3 face=calibri>En rouge<o:p></o:p></FONT></P>

<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT color=#00b0f0 size=3 face=calibri>En bleu<o:p></o:p></FONT></P>

<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT color=#00b050 size=3 face=calibri>En vert<o:p></o:p></FONT></P></FONT>

Do you have a valid solution to replace my html selection ?

 

 

 

Rumen
Telerik team
 answered on 01 Nov 2011
2 answers
193 views
so I've use radwindow alot but now i have a case where the window opens and closes immediately, various threads say to do this in order to cancel the post back "(); return false;" like this:
<telerik:RadButton ID="btnNew" runat="server" OnClientClicked="ShowLectureAuthor(); return false;"   Text="New"
		 ToolTip="Create New File" Skin="Telerik">
		<Icon PrimaryIconUrl="~/images/fileimages/AddRecord.gif" PrimaryIconLeft="5px" />
<Icon PrimaryIconUrl="~/images/fileimages/AddRecord.gif" PrimaryIconLeft="5px"></Icon>
 </telerik:RadButton> 
the javascript which works, looks like this:
    function ShowLectureAuthor() {
        var oWindow = window.radopen("Admin-Lecture-Author.aspx", null);
        oWindow.SetTitle("Author Document");
        oWindow.SetModal(true);
} when I add the (); return false; I get errors on page load and none of the buttons work: Webpage error details

Message: Expected '}'
Line: 762
Char: 421
Code: 0

Really confused , thanks in advance
david
Top achievements
Rank 1
 answered on 01 Nov 2011
2 answers
104 views
Hi,

I am using the version Q2 2011. When I expand the CSS Class combobox for the selected document inside the Document Manager I receive the bunch of errors "File does not exist" (about 50 of them) like http://localhost:51217/Menu/rmRoundedLeft_rtl.png, http://localhost:51217/Common/TreeView/TopLine.pngCommon/TreeView/TopLine.png, http://localhost:51217/Window/WindowHorizontalSprites.png, http://localhost:51217/Grid/rgDrag.gif, etc... And it happens for all embedded skins that I checked so far.

Any explanations and/or work around are greatly appreciated.

Thank you,
Tatiana
Tatiana
Top achievements
Rank 2
 answered on 01 Nov 2011
4 answers
154 views
I used RADGrid Control to create grid data as FreeView. My code in ASP.NET below:


<telerik:RadGrid ID="gridDocs" runat="server" AllowPaging="false" BorderWidth="0px"
        AutoGenerateColumns="False" OnItemCommand="gridDocs_ItemCommand" 
        OnItemDataBound="gridDocs_ItemDataBound" OnItemCreated="gridDocs_ItemCreated" OnColumnCreated="gridDocs_ColumnCreated"
        EnableLinqExpressions="false">
        <%-- JHE :  HierarchyDefaultExpanded="false" parameter which define if all is expanded or not--%>        
        <MasterTableView HierarchyDefaultExpanded="false" HierarchyLoadMode="ServerBind"
            DataKeyNames="ID, ParentID" Width="100%" ExpandCollapseColumn-Display="true" RowIndicatorColumn-Visible="true"
            GridLines="Both"> 
                      
            <NestedViewTemplate>
                <asp:Panel runat="server" ID="InnerContainer">
                    <asp:Label runat="server" ID="lblTest" Text="test"></asp:Label>                         
                  </asp:Panel>
                </NestedViewTemplate>

            
            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Resizable="true">
            <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>
            <SelfHierarchySettings ParentKeyName="ParentID" KeyName="ID"/>  
            <PagerStyle Mode="numericpages" />
            <NoRecordsTemplate>
                no records retrieved
            </NoRecordsTemplate>
            <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>            
            <Columns> 
....
The BOLD lines: I want to View Detail of a row. But If I don't user lines:

 <NestedViewTemplate>
                <asp:Panel runat="server" ID="InnerContainer">
                    <asp:Label runat="server" ID="lblTest" Text="test"></asp:Label>                         
                  </asp:Panel>
                </NestedViewTemplate>


It works OK
If I use the Bold lines to show detail=> it does't work.
The problem: If I use  <NestedViewTemplate>=> The tree view is broken.

attached file is what I exptect: When I click on icon"+"=> detail will be shown.


Pls help me to do it
Thanks alot
Iana Tsolova
Telerik team
 answered on 01 Nov 2011
1 answer
81 views
Unexpected behavior: when highlighting a line of text from right to left, the RadEditor toolbar disappears. I tested IE 8, FF 7, and Chrome 15--of the browsers tested, the behavior only occurs in IE8.

This only occurs if I "sweep" the cursor across the line of text. If I very carefully select only up to the first character in the line, the toolbar remains present.
Rumen
Telerik team
 answered on 01 Nov 2011
14 answers
242 views
I looked up the web and there are plenty of issues/workarounds with handling the viewstates for dynamically created controls and statically designed elements.   However they are more like hacks and I'd prefer to avoid going to that route.

What is the best approach and gotchas if I need to create RadEditor, RadCombo, RadTextbox dynamically?

My page would have some static elements on the top and bottom of the page, and the center of the page would have some dynamically created controls based on what the user has selected from a dropdown.

It will have a RadUpload statically created and a button to validate during postback.
After postback if validation fails, the values the user entered in the dynamically created controls (RadTextbox/Combo/Editor) should remain.

I don't see VS2010 to mention any additional feature to the dynamically created control's viewstate issue.
Marbry
Top achievements
Rank 1
 answered on 01 Nov 2011
1 answer
127 views
Hello ALL,

I have used RadDatePicker into my web page, Now i want to restrict feature date selection to user.

So i had set the max date property as today's date from code behind.it's working properly, user can't able to select feature date from calender.

In case if user try to add feature date manually, then date picker highlighted with warning symbol with yellow color.

But when i click on save button and checked Page.IsValid property, it will always give me true and i got the date picker selected value as null.

How can i validate RadDatePicker for feature date? Please help me.

Here is my code :

aspx :
  <telerik:RadDatePicker ID="dpCompletedDate" Calendar-ShowRowHeaders="false"
                                    Skin="Office2007" runat="server"  />

Page Load cs :
dpCompletedDate.MaxDate = System.DateTime.Now;

Kevin
Top achievements
Rank 2
 answered on 01 Nov 2011
3 answers
229 views
Hello;

I'm trying to add a new row to a Radgrid client-side using insertItem() and then update all inserted items in a single batch.

I've got several questions:

1)  What's the correct way to use the client-side API call insertItem() ?
2)  Can insert operations be batched like edit operations?

Thanks...
Iana Tsolova
Telerik team
 answered on 01 Nov 2011
3 answers
185 views
I'm using resolution 800x600 and when show radwindow with a big size (940 width , 730 height) it shifted up and the controls in the top of the page which is displayed in the radwindow became unreachable .. how to fix this
thanks for effort 
Marin Bratanov
Telerik team
 answered on 01 Nov 2011
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?