Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
342 views
Hi,
Maybe someone out there could help me out here.

I have a Page that binds data to a grid that then (depending on the data within that row) adds a usercontrol to a cell within that row.  The data is bound only once to the grid and I have placed the logic to add the usercontrols to the ItemCreated event for the grid (so that everytime the grid causes a Postback the usercontrols are recreated).  Now there is a need for functionality to allow the user to add a new instance of the user control (of the same type) to the cell.

I have tried the following:

  1. I have used the serverclick event of a button to add the new control to the grid - however, as the control is added after LoadViewState any user entered data to the control is not maintained by Viewstate.  At least on the first passthrough of a Page lifecycle the data is not maintained however, if the Item created event knows that an extra user control is required for a given row then any subsequent postbacks would allow the data entered to be mainteained by Viewstate  Ie.
            -- On first load --
            PAGELOAD (Bind grid)
                -> ONDATABOUND
                -> ONITEMCREATED (adds user controls to specific cell in RadGrid)
            -- On server click to add new control (Causing Postback) --
            ONITEMCREATED (adds user controls to specific cell in RadGrid)
                -> PAGELOAD (Grid not bound)
                -> BUTTONCLICK EVENT (add new usercontrol to correct row)
                (Data entered to added control)
            -- On Second server click to add new control (Causing Postback) --
            ONITEMCREATED (adds user controls to specific cell in RadGrid adding the extra User control for the effected row)
                -> PAGELOAD (Grid not bound)
                (Data entered on added control not set)
                -> BUTTONCLICK EVENT (add new usercontrol to correct row)
                (Data entered to the first added control)
                (Data entered into the newly added control)
            -- On Third server click to add new control (Causing Postback) --
            ONITEMCREATED (adds user controls to specific cell in RadGrid adding the extra 2 User control for the effected rows)
                -> PAGELOAD (Grid not bound)
                (Data entered on first control control set - data entered into second not set)
                -> BUTTONCLICK EVENT (add new usercontrol to correct row)

    I have tried using a variety of different methods to force a manual postback following the Buttonclick event to ensure a new 'full' page lifecycle occurs (after the serverclick event) so that Viewstate saves the user input but this results in a very messy clientside and serverside code...
  2. I added a clientside onclick event to the serverclick button that sets a hidden textbox with data that could be used by the ITEMCREATED event to build the correct usercontrols in the grid.  However, the hidden textbox is always empty when the Itemcreated event is fired as the viewstate has not been loaded at that time following the postback.  I could not think of another way to pass the data to allow it to be available to the Itemcreated method (other than the use of Cookies which would be set by a Javascript function kicked off by the onclick event from the serverclick button... and then this could be consumed by the ItemCreated method)
  3. The final option which does work though performance is poor.. is to Response.Redirect to the page following the button serverclick event... I save required data within the database but the Itemcreated method builds and adds the usercontrols at the right time...

Are there any other ways that people out there could think of to get this to work... Biggest problem is that the ItemCreated event gets fired before PageLoad on Postback.  I think I will proceed with the Cookie method as it allows for performance but there would be the problem that people with Cookies disabled would not be able to use the system... well they could use it...  but the Viewstate not storing entered userdata on dynamically created usercontrols on first appearance would still rear it's ugly head...

Any smart people out there with any other ideas???

Iana Tsolova
Telerik team
 answered on 02 May 2011
1 answer
74 views
Hi,

I have created radfilter with custom dropdowneditor.When I submit the page it passes the correct value for the filter expression.If I click the "Browser back" button,the filter is loading with the selected value in the dropdown.However, if I tried to add another filter ao just simply submit the page again the previously selected value is passing as empty string.
This happens only for the last filter row,which means if I have two filter rows and the lastet value only set as empty.
Please help

Warn.
Tsvetina
Telerik team
 answered on 02 May 2011
3 answers
85 views
Hi -

Im new to Telrik and have downloaded a trial.

Using ASP.NET AJAX, playing with the RadMenu bound to a SQL datasource. This works nicely.

But then, is there any other control that would be suitable to create a Admin System for the menu, so that webmaster can add/remove root menu items, sub level menu items and so on from a protected page.
Any examples/ videos on how to create a menu Admin System? Please advice.

Kind r

Bjørn.
Veronica
Telerik team
 answered on 02 May 2011
1 answer
103 views
I cannot seem to coax RadEditor into adding custom styles to the ApplyClass dropdown.  [See attached image]

Here is what I'm using for RadEditor:

<telerik:RadEditor ID="RadEditor1" runat="server" Skin="Telerik">
    <CssFiles>
        <telerik:EditorCssFile Value="~/Styles/editor.css" />
    </CssFiles>
    <CssClasses>
        <telerik:EditorCssClass Name="Sample" Value=".sample" />
    </CssClasses>
    <Tools>
        <telerik:EditorToolGroup Tag="Formatting">
            <telerik:EditorTool Name="Bold" />
            <telerik:EditorTool Name="Italic" />
        </telerik:EditorToolGroup>
        <telerik:EditorToolGroup>
            <telerik:EditorDropDown Name="FormatBlock">
            </telerik:EditorDropDown>
        </telerik:EditorToolGroup>
        <telerik:EditorToolGroup>
            <telerik:EditorDropDown Name="ApplyClass">
            </telerik:EditorDropDown>
        </telerik:EditorToolGroup>
        <telerik:EditorToolGroup>
            <telerik:EditorTool Name="InsertUnorderedList" />
            <telerik:EditorTool Name="InsertOrderedList" />
            <telerik:EditorSeparator />
            <telerik:EditorTool Name="Outdent" />
            <telerik:EditorTool Name="Indent" />
        </telerik:EditorToolGroup>
        <telerik:EditorToolGroup Tag="MainToolbar">
            <telerik:EditorSplitButton Name="Undo">
            </telerik:EditorSplitButton>
            <telerik:EditorSplitButton Name="Redo">
            </telerik:EditorSplitButton>
            <telerik:EditorSeparator />
            <telerik:EditorTool Name="Cut" />
            <telerik:EditorTool Name="Copy" />
            <telerik:EditorTool Name="Paste" ShortCut="CTRL+V" />
        </telerik:EditorToolGroup>
    </Tools>
    <Content></Content>
</telerik:RadEditor>

And here is the referenced Editor.css file (shown above):

body  
{
    background: #ffffff;
}
.sample
{
    color: Red;
}

Does anyone see why this won't work?  

Gabe
=================
Rumen
Telerik team
 answered on 02 May 2011
1 answer
79 views
I have an asp:button in ma webpage.... but while adding formdecorator, the button is disappearing...but when i checked the source code from the browser i can see thatt the button is there ....but the button is not displaying(both in IE and firefox)... what the reason for this ?...

plss help me......
Bozhidar
Telerik team
 answered on 02 May 2011
3 answers
85 views
When using the scheduler within visual studio I have no problems at all. When I publish the project to the webserver the vertical resource headers don't expand. After some investigation it seems the style sheets are different. Please see screen shots. Any idea how to fix this? I've tried to incorporate some inline style, but without much luck.

Hmm, this seems to be an IE9 issue.
Veronica
Telerik team
 answered on 02 May 2011
2 answers
94 views
Hi Telerik Team,

I don´t know what´s happening. I go to next page in RadGrid and in aleatory way the error message appears (please, see attached image).
I investigated my code line-by-line and I don´t found any problem related with this.
Please, what can I search in my code?

Thanks, best.

Daniel
Daniel Aquere
Top achievements
Rank 2
 answered on 02 May 2011
6 answers
127 views
hello,
I have a grid which has a number of columns,
one of the columns is combobox,
I am getting Data from DB from 2 Tables:

1. a table that populates the combobox - display, code.
2. a table that populates the grid - fields+display.

my problem is that I Indeed get the comboboxes full, but the selected items are always blank .

i tried to change it to label instead of combobox and then i got it right,
but I want it to be combobox.

P. S. I want the combobox to be always avalable to change, without editmode.
Yoni
Top achievements
Rank 1
 answered on 01 May 2011
4 answers
193 views
I'm having a problem with the Editor.  First, it seems to be working just fine, except...

When I create a large block of text in the Editor and then save that text in a SQL Server table, wherever the text ended a line, there is no blank character at the end of the line.  I've attached a screen capture of the SQL server record and you can see (just above the red arrow) where there is no space between the word 'Homes' and the word 'Online', yet when I take this data out the record and display it on a web page, it displays just fine.

Here's my issue...after the editor contents are saved in the SQL database, I process the record searching for certain multi-word strings for some special editing issues involved in translation (without going into too much detail).  If I search this stored string for 'Homes Online Network' the instance shown in the attached graphic is never found -- but it displays just fine with a space between the two words.

Is there some method I can use when retrieving the text field from the SQL database table that will allow my multi-word text search to be successful?

This is probably some kind of stupid question, but I do need the help.  I've read the Editor documentation and searched the knowledgebase, but haven't found anything obvious that helps me.

Thanks in advance!

Lynn
Lynn
Top achievements
Rank 2
 answered on 01 May 2011
2 answers
131 views
Hi:

I am launching a Window maximized, so I just added maximize() to the javascript as follows:

<!-- windows -->
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableViewState="true">
    <Windows>
        <telerik:RadWindow ID="RadWindow1" runat="server"
            Height="600" Width="900" Title="Order Maintenance"
            KeepInScreenBounds="True" VisibleTitlebar="true" Modal="true"
            DestroyOnClose="False" ReloadOnShow="true"
            Behaviors="Close, Maximize, Move, Resize" InitialBehaviors="Maximize" />
    </Windows>
</telerik:RadWindowManager>
<!-- javascript -->
<telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">
    <script type="text/javascript">
        //<![CDATA[
        function orderMaintenanceOpenWindow(ordNbr) {
            var winurl = "OrdersMaintenance.aspx?ordernbr=" + ordNbr;
            var oWnd = radopen(winurl, "orderMaintenanceWindow");
            oWnd.maximize();
            return false;
        }
        //]]>
    </script>
</telerik:RadScriptBlock>

Now, the second launch of the window is maximized, but the complete window is modal.  Can not close it, etc...
What am I missing?
Phil
P.S. Sorry the WindowManager is named ordersSelectionRadWindowManager and the window is named orderMaintenanceWindow.
Phil
Top achievements
Rank 2
 answered on 30 Apr 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?