|
Rank: Member Groups: Member
Joined: 7/29/2011 Posts: 14
|
Using asp:Gridview control, I create an instance for displaying message inside gridview when no records are returned to databind() to control.
Is there an equivalent using your Grid control, or should I just rely on having paging show zero records returned when paging is set?
Also, I noticed that the Grid control resizes to less than the pager/page size values if less than their initial values. Is there someway to keep the Grid control 'height' always the same regardless if the rows returned are greate (max size is reached, no problem), or less than max displayed allowed (grid height shrinks).
I'm trying to keep a uniform GUI such that items below the Grid control bascially stay in the same height location on the page.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
We have posted a new build that implemented EmptyDataText property. Please see your private message for the download location.
As for the Grid height, it SHOULD keep a fixed height if you give it a fixed height. I would recommend you to try it in a separate page and see if it works. If that still does not work, please try to isolate the problem into a test page and post the test page. We will then run the test page here and see if we can reproduce the problem.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 7/29/2011 Posts: 14
|
Thanks for the new build will test out.
As for the height issue, I've set height to 200px, no scrolling, with 'go' pages option. If I nav to a page that has 'less than' the rowcount = 10, it scrunches up to display height only slightly larger than records avail to display.
Duplication is real easy, simply tie a datasource that returns more to trigger multiple page options and navigate until a page has less than set value.
|
|
Rank: Member Groups: Member
Joined: 7/29/2011 Posts: 14
|
installed the new dll.
code: grid1.datasource = nothing grid1.databind()
if grid1.recordcount <= 0 then grid1.emptydatatext = "No Records..." grid1.databind() end if
does nothing. no message displayed, just the pagination stuff and no records at all
|
|
Rank: Member Groups: Member
Joined: 7/29/2011 Posts: 14
|
as for the height staying as set in pagesize regardless of the number of records returned/displayed, the grid height changes perportionally to the number of records less than 10, thus shrinks height.
Thoughts?
|
|
Rank: Member Groups: Member
Joined: 7/29/2011 Posts: 14
|
keeping height fixed works ONLY if you set scrolling. if scrolling is false, then the height value changes based on records available to display.
Appears scrolling understands the 'height' param and adheres to it.
looks funky with scrollbar stopping just above the 'go page' textbox.
if set to auto, the horizontal bar is triggered/displayed which is not needed if your only showing two fields in a grid that is width=970px. more than enough to display contents without forcing horizontal scroll bar.
vertical bar works fine.
can height be honored if not using the scroll bar param?
by turning off paging, looks ok. would have to provide external searching in order to limit number of records loaded.
basically it look like old asp gridview encased in a panel control with scrolling turned on, only that the first row, header row is fixed, which is nice.
any thoughts/help would be appreciated.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
That's normal when you turn off scrolling. The Grid only honors fixed sizes when scrolling is on, otherwise it works much more like the standard ASP.NET GridView. If you do not want it to "shrink to fit", you can either turn on scrolling, or adding fake rows into the Grid, or put the Grid inside a fixed sized DIV (you may want to modify the Grid's style so that the Grid won't have a border, but your outside DIV will have a border).
Thanks!
|
|
Rank: Member Groups: Member
Joined: 7/29/2011 Posts: 14
|
yeah, thought about that. problem is that the pagination stuff shrinks and does not stay 'at bottom' of page.
for now I like the rendering your component provides via scrolling and borders.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
As for EmptyDataText, please try the feature from a separate blank test page first. We tested it and it worked fine here. There might be some difference between your scenario and our test scenario, so unless you can identity what that is, there isn't much we can do about it.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 7/29/2011 Posts: 14
|
could you provide the code you're testing/using?
it might be way I'm trying to implement.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
We don't have any code. We simply drag a Grid into the page, select a style template, set its EmptyDataText property and run it.
Thanks
|
|
Rank: Member Groups: Member
Joined: 7/29/2011 Posts: 14
|
Works Great!!!
LoadRecords("FN", b.Text) ' load the grid based on search criteria
If Grid1.RecordCount <= 0 Then Grid1.EmptyDataText = " No Records Starting With [" + b.Text + "]" End If
I had to add in the in order to format display properly, otherwise wording starts right at left edge of grid.
IN asp gridview, I had to set a new instance of the gridview, then assign the words to it in order to display. This/yours approach is cleaner and simple.
Thanks again.
|
|