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

cell with a null value returns ' '

1 Answer 142 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Neelima
Top achievements
Rank 1
Neelima asked on 26 Oct 2010, 07:09 PM

When I try to retrive a cell value, its returning ' ' if the value is null. Is something wrong in the code?
why doesn't it just return empty string('') instead of ' '?

Thank you
Neelima

Private Sub RadgridDestination_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadgridDestination.SelectedIndexChanged   
        
Dim row As GridDataItem = RadgridDestination.Items(RadgridDestination.SelectedIndexes(0))   
        
btnUpdate.Visible = True 
        
uc_Addr.Visible = True 
        
btnAdd.Visible = False 
        
With uc_Addr  ' uc_Addr is an User Control  
        
.Desc = row("Description").Text   
        
.Addr1 = row("Address1").Text   
        
.Addr2 = row("Address2").Text  'retuns ' ' if the cell value is null. 
        
.State.SelectedValue = row("StateID").Text   
        
.City.SelectedValue = row("CityID").Text   
        
.Zip.SelectedValue = row("ZipID").Text 
        
.Phone = row("Phone").Text  'retuns ' ' if the cell value is null.  
        
End With 
End Sub

<telerik:RadGrid ID="RadgridDestination" runat="server" 
     AllowSorting="True"  ShowGroupPanel="True" 
     AutoGenerateColumns="False"
          Skin="Sunset" AllowPaging="True" GridLines="None">
  
        <GroupingSettings ShowUnGroupButton="True"  />
        <ClientSettings AllowDragToGroup="True" allowcolumnsreorder="True" 
            columnsreordermethod="Reorder" reordercolumnsonclient="True" >
        </ClientSettings>
          
  
<MasterTableView EditMode="InPlace" DataKeyNames="Destination_ID" GroupLoadMode="Client" >
<CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
  
    <Columns>
          
         <telerik:GridButtonColumn CommandName="Select" Text="Edit"  ButtonType="ImageButton"
            UniqueName="column1" 
            ImageUrl="Images/Edit.gif">
        </telerik:GridButtonColumn
      <telerik:GridBoundColumn DataField="Destination_ID" HeaderText="Destination_ID" visible="False" UniqueName="Destination_ID" ReadOnly="true"/>
                         <telerik:GridBoundColumn DataField="Addr_Desc" HeaderText="Description"  UniqueName="Description" ReadOnly="true"></telerik:GridBoundColumn>
                         <telerik:GridBoundColumn DataField="Addr1" HeaderText="Address1" UniqueName="Address1" ReadOnly="true"></telerik:GridBoundColumn>
                         <telerik:GridBoundColumn DataField="Addr2" HeaderText="Address2" UniqueName="Address2" ReadOnly="true"></telerik:GridBoundColumn>
                         <telerik:GridBoundColumn DataField="City" HeaderText="City" UniqueName="City" ReadOnly="true"></telerik:GridBoundColumn>
                         <telerik:GridBoundColumn DataField="State" HeaderText="State" UniqueName="State" ReadOnly="true"></telerik:GridBoundColumn>
                         <telerik:GridBoundColumn DataField="Zip" HeaderText="Zip" UniqueName="Zip" ReadOnly="true"></telerik:GridBoundColumn>
                         <telerik:GridBoundColumn DataField="Phone" HeaderText="phone" UniqueName="Phone" ReadOnly="true"></telerik:GridBoundColumn>
                         <telerik:GridBoundColumn DataField="Start_Latitude" HeaderText="Lat" UniqueName="Lattitude" ReadOnly="true"></telerik:GridBoundColumn>
                         <telerik:GridBoundColumn DataField="Start_Longitude" HeaderText="Longt" UniqueName="Longitude" ReadOnly="true"></telerik:GridBoundColumn>
                         <telerik:GridBoundColumn DataField="State_ID" UniqueName="StateID" Visible="false"></telerik:GridBoundColumn>
                         <telerik:GridBoundColumn DataField="City_ID" UniqueName="CityID" Visible="false"></telerik:GridBoundColumn>
                         <telerik:GridBoundColumn DataField="Zip_ID" UniqueName="ZipID" Visible="false"></telerik:GridBoundColumn>
                      
            <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" 
            Text="Delete" UniqueName="Delete">
        </telerik:GridButtonColumn>
                      
            </Columns>
           <EditFormSettings>
<EditColumn UniqueName="EditCommandColumn1"></EditColumn>
</EditFormSettings>
</MasterTableView>
  
  
    </telerik:RadGrid>

1 Answer, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 27 Oct 2010, 09:10 AM
Hello Neelima,

We insert these tags as a workaround to a well-known bug in IE.  The problem is that if the cells are empty, Internet Explorer 7 hides the borders completely.

Please examine the following links for more information:
IE not rendering borders on empty table cells
Empty cells in HTML tables

You can reproduce the problem with a simple HTML table - just put it in your website and run IE8 in compatibility mode.
Copy Code
<table border="1">
    <tr>
        <td>1</td>
        <td>2</td>
        <td>3</td>
    </tr>
    <tr>
        <td>4</td>
        <td></td>               
        <td>5</td>
    </tr>
    <tr>
        <td></td>
        <td></td>
        <td>6</td>
    </tr>
</table>


Regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Neelima
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or