Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
219 views
Hi, I am collecting information from the user in a RadWindow.

The RadWindow contains a repeater control.  Each item in the Repeater control contains a regular asp.net CheckBox and TextBox control.  When I iterate through the items of the repeater on postback, the items do not contain the values that were entered by the user, but default values instead.

The markup looks like this:

<telerik:RadWindowManager ID="RadWindowManager1" runat="server">

    <Windows>

         <telerik:RadWindow

                ID="rwManageCategories" 

                runat="server"

                Title="Manage Categories" 

                Height="400px"

                Width="600px" 

                Left="150px" 

                ReloadOnShow="true" 

                ShowContentDuringLoad="false" 

                Modal="true"

                Behaviors="None" 

                KeepInScreenBounds="True" 

                VisibleStatusbar="False"

         >

            <ContentTemplate>

                <asp:Label ID="lblRulesetCategories" runat="server"></asp:Label><br /><br />

                <asp:Label ID="lblErrorRulesetCategories" ForeColor="Red" runat="server"></asp:Label>

                <asp:Repeater ID="rptrRulesetCategories" runat="server">

                    <ItemTemplate>

                        <asp:CheckBox id="cbRulesetCategorySelected" Checked='<%# Eval("IsSelected") %>' runat="server"></asp:CheckBox>

                        <asp:HiddenField ID="hdnCategoryId" Value='<%# Eval("CategoryId") %>' runat="server" />

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

                        <asp:TextBox ID="tbRulesetCategorySequence" Text='<%# Eval("Sequence") %>' runat="server"></asp:TextBox>

                        <asp:CompareValidator ID="cvRulesetCategorySequence" ControlToValidate="tbRulesetCategorySequence" Operator="DataTypeCheck" Type="Integer" Text="* Invalid" Display="Dynamic" runat="server"></asp:CompareValidator>

                        <br />

                    </ItemTemplate>

                </asp:Repeater>

                <br />

                <br />

                <asp:Button ID="btnManageCategoriesSave" Text="Save" OnClick="btnManageCategoriesSave_Click" runat="server" />

                <asp:Button ID="btnManageCategoriesCancel" Text="Cancel" OnClick="btnManageCategoriesCancel_Click" runat="server" />

            </ContentTemplate>

         </telerik:RadWindow>

    </Windows>

</telerik:RadWindowManager>


The code-behind looks like this:

    protected void btnManageCategoriesSave_Click(object sender, EventArgs e)

    {

        // Get collection of checked ruleset categories in repeater

        var checkedCategoryIDs = from ri in this.rptrRulesetCategories.Items.Cast<RepeaterItem>()

                                 let hdnCategoryId = (HiddenField)ri.FindControl("hdnCategoryId")

                                 let cbRulesetCategorySelected = (CheckBox) ri.FindControl("cbRulesetCategorySelected")

                                 let tbRulesetCategorySequence = (TextBox)ri.FindControl("tbRulesetCategorySequence")

                                 select new

                                 {

                                     CategoryId = Convert.ToInt32(hdnCategoryId.Value),

                                     Checked = cbRulesetCategorySelected.Checked,

                                     Sequence = tbRulesetCategorySequence.Text == "" ? null : tbRulesetCategorySequence.Text

                                 };

}

When I hover over the checkedCategoryIDs variable, the Checked value is always false and the Sequence value is always blank for all items even though I do check various checkboxes, and enter values into various sequence textboxes.  This doesn't appear to be a problem with my LINQ statement, as I can also enter the following into the immediate window and still get a blank value:

? ((TextBox) this.rptrRulesetCategories.Items[0].FindControl("tbRulesetCategorySequence")).Text
""

The radwindow was working before when I was using a checkboxlist instead of a repeater, and I was using the same approach with collecting the values in a LINQ statement...

Any ideas on how I can resolve this?

Thanks,
James

** UPDATE **
My bad, the radwindow works fine.  I was rebinding the repeater, and erasing the values before I had a chance to retrieve them...
Svetlina Anati
Telerik team
 answered on 20 May 2010
1 answer
48 views
Hi,

I have used your product and its working great. I have added support for javascript. But please suggest me how to add support for asp code. If somebody wants to put asp code, please help me. I have tried putting AllowScripts="True" and its working for javascript, however
for asp, i am looking at actual code and not content on website !!

Thanks a ton,

Regards,

Gaurav Saxena
Rumen
Telerik team
 answered on 20 May 2010
1 answer
80 views
I am trying to add some custom images to the end of each GroupHeader in my grid. In the ItemDataBound event, I am catching all the GridGroupHeaderItem occurrences and doing the following:

item.DataCell.Text = string.Format("<table style='border-collapse: none' class='groupcontrol'><tr><td>{0}</td><td>{1}</td><td>{2}</td></tr></table>", item.DataCell.Text, 
                                                   "<div onclick='WorkAreaControl_SelectGroupRows()' title='Select All Accounts In This Group Only'><img src='../App_Themes/Office/Images/16x16/Download Add.png'/>&nbsp;Select All In Group</div>", 
                                                   "<div onclick='WorkAreaControl_DeselectGroupRows()' title='Deselect All Accounts In This Group Only'><img src='../App_Themes/Office/Images/16x16/Download Delete.png'/>&nbsp;Deselect All In Group</div>"); 
 

When this renders, I am getting an extra paragraph <p> element before and after this table.  Why is that happenng and how do I make it stop?

I have attached a screenshot that show the grid and the HTML markup generated below it


Yavor
Telerik team
 answered on 20 May 2010
1 answer
77 views
Hi,

I have customized the wizard to the extent of merely changing the text and .css design and embedding the page in a masterpage.  I'm getting the following common error... "Object reference not set to an instance of an object." ... when I click the next button in the first control:

<asp:Button runat="server" ID="nextButton" Text="Next" OnClick="nextButton_Click" 
    CssClass="nextButton" PostBackUrl="wizard.aspx" /> 

The line of code it's hanging on is the first label update in the Preview section.

Label 
titleLabelPreview = (Label)previewControl.FindControl("titleLabel"); 

Would this be related to changes I have ignored after using a masterpage?


Yana
Telerik team
 answered on 20 May 2010
2 answers
112 views
Hi guys, the problem i have is i have a chat type control, that displays a list of users comments, when a user enters a comment into this control they have the ability to edit this comment, which pops up inside a RadWindow.... when the rad window closes (they've submitted their changes) we have an OnAjaxRequest on our AJAX manager... that catches the submit from the RadWindow... we go into a method on the server side public void RefreshPage(object sender, AjaxRequestEventArgs e) which at the moment all this method does is try to update a label within the RadAJAXPanel when the Window requests the refreshpage.. however this does nothing... the only way we are able to achieve a refresh is to do a response.redirect.. which isnt ideal as its a noticable refresh of the whole page... any suggestions on refreshing just the controls within the RadAJAXPanel would be fantastic!

Cheers

Fiko
Telerik team
 answered on 20 May 2010
4 answers
366 views
Hello,

I am having problem with my dropdownlist. I set the the width to 100% and my page design is fluid. when i resize my browser it the dropdownlist width does not follow. As a result the dropdown overshoot the margin as shown on the attached image. 

I tried removing the radformdecorator and it worked just fine. However I want to be consistent on my design and continue using radformdecorator.

thanks
Petio Petkov
Telerik team
 answered on 20 May 2010
13 answers
307 views
Hi,

We used the GridSettingsPersister helper class to allow users to save "views" and store those settings in a database.

We upgraded our DLL to the newest release and it seems we are now getting this error. Thoughts?

Thanks

Could not load file or assembly 'Telerik.Web.UI, Version=2009.3.1314.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileLoadException: Could not load file or assembly 'Telerik.Web.UI, Version=2009.3.1314.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Source Error:

 

Line 78:             LosFormatter formatter = new LosFormatter();

Line 79:             StringReader reader = new StringReader(settings);

Line 80:             object[] gridSettings = (object[])formatter.Deserialize(reader);

Line 81:             //Load groupBy

Line 82:             GridGroupByExpressionCollection groupByExpressions = this.gridInstance.MasterTableView.GroupByExpressions;

Veli
Telerik team
 answered on 20 May 2010
1 answer
170 views
Hello Everybody,
in my application I used a RadGrid to represent the company's founders, using 3 buttons outside the grid, how can I Insert/Edit/Delete the data in the grid, I studied the AllEditableColumns example you have done and I learned a lot from it, but my application is a little bit different, I shouldn't reflect any changes on the DB until I press the submit button, which means if I add a record the record won't be added to the database until I press submit the same applies for delete/edit operations
so I need temporialy to reflect the changes on the grid using javascript functions, but my problem is the edit/insert/delete buttons are outside the grid, so how can I show the edit form for the selected row when I press edit??? and how can I get the updated values after applying the changes?

P.S I should use javascript to show the edit form and to get the changes and to reflect them on the grid, your help is really appreciated

the grid looks like this:
<telerik:RadGrid ID="RadGrid1" GridLines="None" runat="server" AllowAutomaticDeletes="True"
            AllowAutomaticInserts="True" PageSize="10" AllowAutomaticUpdates="True" AllowPaging="True"
            AutoGenerateColumns="False"  OnDataBound="RadGrid1_DataBound">
            <PagerStyle Mode="NextPrevAndNumeric" />
            <MasterTableView Width="100%" CommandItemDisplay="TopAndBottom" DataKeyNames="FounderId"
EditMode="InPlace" HorizontalAlign="NotSet"  AutoGenerateColumns="False">
                <Columns>
                    <telerik:GridBoundColumn DataField="FounderId" HeaderText="Founder ID"
                        UniqueName="FounderId" ColumnEditorID="FounderIdColumnEditor">
                    </telerik:GridBoundColumn>
                    <telerik:GridNumericColumn DataField="FounderName" HeaderText="Founder Name"
                       UniqueName="FounderName" ColumnEditorID="FounderName ColumnEditor">
                    </telerik:GridNumericColumn>
                </Columns>
                <EditFormSettings ColumnNumber="2" CaptionDataField="Founder tName" CaptionFormatString="Edit properties of Founder {0}">
                    <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                    <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White"
                        Width="100%" />
                    <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" />
                    <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                    <EditColumn ButtonType="ImageButton" InsertText="Insert Founder" UpdateText="Update record"
                        UniqueName="btnUpdate" CancelText="Cancel edit">
                    </EditColumn>
                    <FormTableButtonRowStyle HorizontalAlign="Right"></FormTableButtonRowStyle>
                </EditFormSettings>
            </MasterTableView>
            <ClientSettings>
                <ClientEvents OnRowDblClick="RowDblClick" />
            </ClientSettings>
        </telerik:RadGrid>
        <telerik:GridTextBoxColumnEditor ID="SharesKindDescreptionColumnEditor" runat="server"
            TextBoxStyle-Width="200px" />
        <telerik:GridTextBoxColumnEditor ID="SharesKindValueColumnEditor" runat="server"
            TextBoxStyle-Width="150px" />
        <table>
            <tr>
                <td align="left">
                    <table>
                        <tr>
                            <td>
                                <asp:ImageButton ToolTip="Add Founder" ID="btnAdd" runat="server"
                                    OnClientClick="AddNewFounder();" ImageUrl="~/Images/IconAdd_Text_Dialog.png" />
                            </td>
                            <td>
                                <asp:ImageButton ToolTip="Update Founder" ID="btnUpdate" runat="server"
                                    OnClientClick="UpdateFounderInfo();" ImageUrl="~/Images/IconEdit_Text_Dialog.png" />
                            </td>
                            <td>
                                <asp:ImageButton ToolTip="Delete Founder" ID="btnDelete" runat="server"
                                    OnClientClick="DeleteFounderInfo();" ImageUrl="~/Images/IconDelete_Text.png" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>

Regards and thanks in advance,
Hamza
Yavor
Telerik team
 answered on 20 May 2010
4 answers
190 views
Hi,

I have hit a ludicrous problem. Using regular asp.net controls, I can add a few items to a listbox and set the initial item to have:
Value=""
Text="Please select"

This means that error checking is very easy as I only have to check for an empty string to catch a required validator.

I am using a radcombo in conjunction will JQuery Validator and I need to be able to do the same otherwise I have no way of checking whether the user has selected an item. Currently the only way I can see how to do it is set the item to :
Value=""
Text=""

This is no good as I need to display the text "Please select"

Any help appreciated.

Thanks
Ben White
Top achievements
Rank 1
 answered on 20 May 2010
6 answers
168 views
Having the following issue with a RadWindow when it pops up on the following screen. as you can see the RadWindow is being half obscured. I believe this might be a problem with the Z index, but unsure how to resolve... but the control "below it" is placeholder thats loading a document inside it (microsoft office/pdf's etc.). Any suggestions on how to fix this one would be fantastic

i'm on Q1 2010

See attached image for what i mean.
Kevin
Top achievements
Rank 2
 answered on 20 May 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?