HI
I have two login like admin and user.my doubt is when i login as admin the grid want to show hole record in the database but when i login as user it want to show particular record for that user how it ll be done..this is my doubt if somebody give solution for this
I have two login like admin and user.my doubt is when i login as admin the grid want to show hole record in the database but when i login as user it want to show particular record for that user how it ll be done..this is my doubt if somebody give solution for this
4 Answers, 1 is accepted
0
Mugil
Top achievements
Rank 1
answered on 12 Mar 2013, 06:27 PM
can anyone give solution for this asap
0
Hi Mugil,
You can use Advanced data-binding to achieve the requested functionality:
http://www.telerik.com/help/aspnet-ajax/grid-advanced-data-binding.html
Hope this helps. Please give it a try and let me know if it works for you.
All the best,
Eyup
the Telerik team
You can use Advanced data-binding to achieve the requested functionality:
http://www.telerik.com/help/aspnet-ajax/grid-advanced-data-binding.html
protected
void
RadGrid1_NeedDataSource(
object
sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
if
(
true
)
// user has full access
{
RadGrid1.DataSource = GetFullDataMethodName();
}
else
{
RadGrid1.DataSource = GetLimitedDataMethodName();
}
}
Hope this helps. Please give it a try and let me know if it works for you.
All the best,
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
Mugil
Top achievements
Rank 1
answered on 15 Mar 2013, 01:59 PM
HI Eyup,
Thank you for your reply
If u don't mind can u explain it clearly because im new to this.
thanking you,
P.Mugil
Thank you for your reply
If u don't mind can u explain it clearly because im new to this.
thanking you,
P.Mugil
0
Hi Mugil,
In the if statement you should place logic that checks whether the user is an admin or not. If the user is an admin then the GetFullDataMethodName method will be called. This method should return the whole set of records from the database. If the user however is not an admin you should implement logic inside the GetLimitedDataMethodName method which should extract and return a concrete set of data that meets you requirements.
Note that RadGrid.DataSource excepts an object. The only requirement is that the custom object to which the grid will be bound should implement the ITypedList/IEnumarable/ICustomTypeDescriptor interfaces.
Regards,
Angel Petrov
the Telerik team
In the if statement you should place logic that checks whether the user is an admin or not. If the user is an admin then the GetFullDataMethodName method will be called. This method should return the whole set of records from the database. If the user however is not an admin you should implement logic inside the GetLimitedDataMethodName method which should extract and return a concrete set of data that meets you requirements.
Note that RadGrid.DataSource excepts an object. The only requirement is that the custom object to which the grid will be bound should implement the ITypedList/IEnumarable/ICustomTypeDescriptor interfaces.
Regards,
Angel Petrov
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.