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

CommandItemDisplay is appearing when RadGrid select no rows

2 Answers 77 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Syed
Top achievements
Rank 1
Syed asked on 12 May 2009, 12:11 PM
Hi,
I am connecting the sqldatasource dynamically to the RadGrid and i have the following selected command;

SELECT [Assignment], [Task], [M9_Sep], [M10_Oct], [M11_Nov], [M12_Dec], [M1_Jan], [M2_Feb], [M3_Mar], [M4_Apr], [M5_May], [sno], [Resource_Name], [Resource_Year], [Resource_Month], [Resource_week], [Division_ID], [Section_ID] FROM [Resource_Data] WHERE (([Resource_Name] = @Resource_Name) AND ([Division_ID] = @Division_ID) AND ([Section_ID] = @Section_ID) AND ([Resource_Year] = @Resource_Year) AND ([Resource_Month] = @Resource_Month) AND ([Resource_week] = @Resource_week)) 
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click  
        RadGrid1.DataSourceID = "Sqldatasource3" 
End Sub 
I specify commanditemdisplay="Top" and set the properties       allowautomaticinsert,delete and update.

Sometimes i am getting no rows because of above condition fails. Its ok for me.

The problem i am getting that i cannot able to see "Add a new Record". Only a single line appearing for the grid.

I don't what exactly went wrong.

Thanks.

 

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 13 May 2009, 04:40 AM
Hi Syed,

I guess the Grid is shown only as single line when there are no records in the Grid. Try setting the ShowHeadersWhenNoRecords property to true and see whether it works.

ASPX:
 
 <MasterTableView  DataKeyNames="ProductID"  ShowHeadersWhenNoRecords="true" CommandItemDisplay="top"  > 


Shinu
0
Syed
Top achievements
Rank 1
answered on 13 May 2009, 10:10 AM
I see the properties are already set to ShowHeadersWhenNoRecords="true" .

Even though there are records, its not displaying.

Let me tell you the situation of my form. Grid is displaying rows when i change RadCombo items. Once i selected RadCombo it displaying the rows.  When the page is open in browser, the first item of radcombo appears and single line is appearing. But when i select 2nd item, i find Header "Add a new Record" is displaying even though no records available. Again if i selected an first item from RadCombo, now i can able to see "Add a new Record".

I guess some is wrong with the RadCombo at the first time when the page load. But everything works fine when i select another item from the RadCombo.

Thanks.

Regards
Syed Arshad
Tags
Grid
Asked by
Syed
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Syed
Top achievements
Rank 1
Share this question
or