Is there any easy way to center (both horizontally and vertically) a NoRecordsTemplate within the body of the RadGrid when using:
on a RadGrid that has a height of 100%?
<
ClientSettings
EnableRowHoverStyle
=
"true"
>
<
Scrolling
AllowScroll
=
"true"
UseStaticHeaders
=
"true"
></
Scrolling
>
<
Selecting
AllowRowSelect
=
"true"
></
Selecting
>
</
ClientSettings
>
on a RadGrid that has a height of 100%?
4 Answers, 1 is accepted
0

Shinu
Top achievements
Rank 2
answered on 28 Mar 2013, 04:21 AM
Hi,
Try the following CSS.
CSS:
Thanks,
Shinu
Try the following CSS.
CSS:
.rgNoRecords td
{
text-align
:
center
!important
;
}
Thanks,
Shinu
0

Xorcist
Top achievements
Rank 1
answered on 28 Mar 2013, 01:44 PM
That will only get me horizontal. I'm using:
and a grid height of 100% because I want my grid to size to the window (and that works perfectly). But I want to try and center my "No Records Found" message BOTH horizontally and vertically so it shows in the very center of the grid body.
Edit: If I change the parent table to have a height of 100% (Tested in FireFox w/ FireBug) I get the results I want, but I only want to do this when the no records template is shown... any ideas on how to achieve this?
<
ClientSettings
EnableRowHoverStyle
=
"true"
>
<
Scrolling
AllowScroll
=
"true"
UseStaticHeaders
=
"true"
></
Scrolling
>
<
Selecting
AllowRowSelect
=
"true"
></
Selecting
>
</
ClientSettings
>
and a grid height of 100% because I want my grid to size to the window (and that works perfectly). But I want to try and center my "No Records Found" message BOTH horizontally and vertically so it shows in the very center of the grid body.
Edit: If I change the parent table to have a height of 100% (Tested in FireFox w/ FireBug) I get the results I want, but I only want to do this when the no records template is shown... any ideas on how to achieve this?
0
Hello John,
You can try the following approach:
Hope this helps. Please give it a try and let me know if it works for you.
Regards,
Eyup
the Telerik team
You can try the following approach:
function
pageLoad() {
var
masterEl = $find(
"<%= RadGrid1.ClientID %>"
).get_masterTableView().get_element();
var
noItemsEl = $(masterEl).find(
".rgNoRecords"
)[0];
if
(noItemsEl) {
masterEl.style.height =
"95%"
;
$(masterEl).find(
".rgNoRecords"
).children()[0].style.textAlign =
"center"
;
}
}
Hope this helps. Please give it a try and let me know if it works for you.
Regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0

Xorcist
Top achievements
Rank 1
answered on 02 Apr 2013, 02:49 PM
That looks like it works, thanks.