This is a migrated thread and some comments may be shown as answers.

Problem Using TextBox to display values from Grid

3 Answers 66 Views
Input
This is a migrated thread and some comments may be shown as answers.
Suzan
Top achievements
Rank 1
Suzan asked on 15 Apr 2011, 02:13 PM

<
telerik:RadPageView ID="RadPageView4" runat="server">
                <div style="padding-right: 10px; padding-left: 10px;">
                    <br />
                    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BorderStyle="Solid">
                        <asp:Label ID="Label2" runat="server" ForeColor="Red">Loading... </asp:Label>
                        <br />
                        <asp:Image ID="Image1" runat="server" ImageUrl="WebBlue\Ajax\WebBlue.gif" />
                    </telerik:RadAjaxLoadingPanel>
                   <asp:Panel ID="Panel1" runat="server">
                        <table cellspacing="2px" cellpadding="0px">
                            <tr>
                                <td colspan="2">
                               <asp:Label ID="lblGrade" runat="server"> Grade:</asp:Label>
                                     
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <label for="txtComment1">
                                       Comment 1:</label>
                                    <br />
                                    <telerik:RadTextBox ID="txtComment1" runat="server" TextMode="MultiLine" Rows="5"
                                        Columns="6" Height="50px" ReadOnly="true" Width="320px" Skin="WebBlue"/>
                                    <br />
                                </td>
                                <td>
                                    <label for="txtTarget1">
                                        Target 1:</label>
                                    <br />
                                    <telerik:RadTextBox ID="txtTarget1" runat="server" TextMode="MultiLine" Rows="5"
                                        Columns="6" Height="50px" ReadOnly="true" Width="320px" Skin="WebBlue"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <label for="txtComment2">
                                        Comment 2:</label>
                                    <br />
                                    <telerik:RadTextBox ID="txtComment2" runat="server" TextMode="MultiLine" Rows="5"
                                        Columns="6" Height="50px" Width="320px" Skin="WebBlue">
  
                                 </telerik:RadTextBox>
                                </td>
                                <td>
                                    <label for="txtTarget2">
                                        Target 2:</label>
                                    <br />
                                    <telerik:RadTextBox ID="txtTarget2" runat="server" TextMode="MultiLine" Rows="5"
                                        Columns="6" Height="50px" Width="320px" Skin="WebBlue" />
                                </td>
                            </tr>
                            <tr>
                            </tr>
                        </table>
                    </asp:Panel>
                    <br />
                    <telerik:RadGrid ID="RadGridReviews" runat="server" AutoGenerateColumns="False" Skin="WebBlue"
                        OnItemCommand="OnSelectRecords" Width="400px">
                        <MasterTableView ShowFooter="true" DataKeyNames="qualcode">
                            <RowIndicatorColumn Visible="true" UniqueName="RowIndicator">
                                <HeaderStyle Width="20px" BackColor="LightSkyBlue" />
                            </RowIndicatorColumn>
                            <Columns>
                                <telerik:GridBoundColumn DataField="reference" Visible="False" UniqueName="ColumnRef">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="qualcode" HeaderText="Qualification" ItemStyle-Width="100">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="classcode" HeaderText="Class" ItemStyle-Width="150" UniqueName="ColumnClass">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="review" HeaderText="Review" UniqueName="ColumnReview"
                                    ItemStyle-Width="100">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="attainment_grade" Visible="False" UniqueName="ColumnGrade">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="comment1" Visible="False" UniqueName="ColumnComment1">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="comment2" Visible="False" UniqueName="ColumnComment2">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="target1" Visible="False" UniqueName="ColumnTarget1">
                                </telerik:GridBoundColumn>
                                  <telerik:GridBoundColumn DataField="target2" Visible="False" UniqueName="ColumnTarget2">
                                </telerik:GridBoundColumn>
                            </Columns>
                        </MasterTableView>
                        <ClientSettings EnableRowHoverStyle="true"
                            EnablePostBackOnRowClick="true">
                            <Selecting AllowRowSelect="true" />
                             
                        </ClientSettings>
I am using one page of a multi page to display a grid, a label and four text boxes
As you can see from the code above the Grid has five invisible columns. When a row of the grid is selected the data in the invisible columns is displayed in the label and the text boxes. When the data fields only contain a single space "nbsp;" is displayed in the text boxes(see attached screenshot) instead of leaving them blank. Is there an easy way of making sure the text box is displayed as an empty box?
Also is there a style of text box or a way of changing the style sheet so that the label is displayed above the text box rather than on the left hand side?

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 21 Apr 2011, 08:52 AM
Hello Suzan,

I recommend that you examine the forum thread below which elaborates on this matter and see if it helps:
http://www.telerik.com/community/forums/aspnet/grid/radgrid-edit-mode-displaying-quot-amp-nbsp-quot-in-text-box.aspx

Regards,
Pavlina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Suzan
Top achievements
Rank 1
answered on 21 Apr 2011, 11:15 AM
Thanks for the advice. I have worked out how to solve the problem using javascript and client-side events, but this advice will be useful
if I need to post back to the server to get the required values.
0
Pavlina
Telerik team
answered on 26 Apr 2011, 02:11 PM
Hi Suzan,

Go through the following link and see if it helps:
http://www.google.bg/#hl=bg&source=hp&biw=1676&bih=837&q=Replace+%26nbsp&aq=f&aqi=&aql=&oq=&fp=a355cd77dc8f3e48

Kind regards,
Pavlina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Input
Asked by
Suzan
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Suzan
Top achievements
Rank 1
Share this question
or