Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
161 views
Many people here ask about how to do either client or server filtering. What about both? And are there any best practices for balancing this?

Say you have a database with a million transactions from which you want to select only items from this year, an dyou know there are about 100 thousand of these. With a good database query this may return results quickly but there is overhead for going to the server, and then the resulting data needs to be paged.

For subsequent filtering when the user changes the filter in the grid, we have some options:
1) Go back to the server and perform another query from scratch using the user-defined refinement.
2) Go back to the server, and just refine the already selected subset of data stored in state "somewhere" (maybe a LINQ query on a collection stored in cache, rather than a SQL query to a relational database).
3)  Filter the current subset on the client.

The ultimate question is, how do we know if the user wants to filter the subset of data, or if they want to filter on all data? For the above example, if we have a grid that displays countries and the filter is set to EqualTo USA, is that all USA transactions regardless of date, or all transactions for this year in the USA?

The user needs a button or other mechanism that clarifies their intent.  For this we have seen examples where a text box is used for the user to enter a pre-filter, and the grid always operates on the subset of data provided there.  In my opinion this is redundant and inadequate compared with the more sophisticated filter mechanism already provided in the grid.

How are people dealing with this? When a user changes their filter, which of the three above operations are you performing, and how do you allow the user to go back to a full query or refine their selection?

Thanks!
TonyG
Top achievements
Rank 1
 asked on 14 Sep 2011
0 answers
147 views
I am trying to loop through a radGrid with jQuery to access it Edit link. So basically what I want to do is show a modal dialog whenever the Edit link is clicked. I have the Modal dialog working using jquery and it is activated based on the .click jquery event. Is there a way to make it so when ever you click an Edit link in the radGrid it activates that?

This is my jquery code:
<script>
 
    $(document).ready(function() {
 
        //select all the a tag with name equal to modal
        $("#imgBtnBack").click(function(e) {
        if (($("#radTextBoxNotes_text").val().length === 0) && ($('#rblChangeButtonType input:checked').val() == '100000000') && ($("#RadDatePicker1").val().length === 0)) {
                history.back();
                return false;
            } else {
                //Cancel the link behavior
                e.preventDefault();
                //Get the A tag
                var id = "#dialog";
 
                //Get the screen height and width
                var maskHeight = $(document).height();
                var maskWidth = $(window).width();
 
                //Set height and width to mask to fill up the whole screen
                $('#mask').css({ 'width': maskWidth, 'height': maskHeight });
 
                //transition effect    
                $('#mask').fadeIn(0);
                $('#mask').fadeTo("fast", 0.8);
 
                //Get the window height and width
                var winH = $(window).height();
                var winW = $(window).width();
 
                //Set the popup window to center
                $(id).css('top', winH / 2 - $(id).height() / 2);
                $(id).css('left', winW / 2 - $(id).width() / 2);
 
                //transition effect
                $(id).fadeIn(0);
            }
        });
        //if close button is clicked
        $('.window .close').click(function(e) {
            //Cancel the link behavior
            e.preventDefault();
            $('#mask, .window').hide();
        });
 
        //if mask is clicked
        $('#mask').click(function() {
            $(this).hide();
            $('.window').hide();
        });
    });
    function OnClientClicked(sender, eventArgs) {
        //if close button is clicked
        $('.window .close').click(function(e) {
            //Cancel the link behavior
            e.preventDefault();
            $('#mask, .window').hide();
        });
        
    }
</script>


Thanks!
Justin
Top achievements
Rank 1
 asked on 14 Sep 2011
1 answer
69 views
when I have controls inside form template which is inside radgrid I am unable to
see them in design view, only grid is visible forcing me to move form template controls
to user control or manually design layout in code view. Is this a bug or supposed to be like that ?
I can not justify implementing a user control for that so right now I am using another temp aspx page where
I do layout and then paste it in form template, not very efficient :(
Jayesh Goyani
Top achievements
Rank 2
 answered on 14 Sep 2011
1 answer
222 views
Hi
I need to place 2 colums inside grid that 2 columns(Radshowattendedtraining,RadshowProvidedtraining) are two different grid please see the code below my problem is i am not able to use grid inside template column only outer grid is visible in code behind but in asp.net control  it is possible to bind the data.plaese suggest iam new to telerik

<

 

asp:Panel runat="server" ID="InnerContainer" >

 

 

 

 

<telerik:RadGrid ID="Radshowtraining" AllowMultiRowSelection="false" AllowSorting="false" runat="server" GridLines="None"

 

 

AllowFilteringByColumn="true" AllowPaging="true" AutoGenerateColumns ="false" PageSize="10" >

 

 

<ClientSettings EnableRowHoverStyle="true" ReorderColumnsOnClient="True" >

 

 

<Selecting AllowRowSelect="true" />

 

 

</ClientSettings>

 

 

 

<MasterTableView Width="100%" AllowMultiColumnSorting="false" AutoGenerateColumns="false"

 

 

DataKeyNames="Id" ClientDataKeyNames="Id">

 

 

 

<Columns>

 

 

 

<telerik:GridTemplateColumn UniqueName="TemplateDeleteColumn" HeaderText="Attended"

 

 

AllowFiltering="false" HeaderStyle-HorizontalAlign="Center" HeaderStyle-VerticalAlign="Middle"

 

 

ItemStyle-VerticalAlign="Middle" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="150px">

 

 

<ItemTemplate>

 

 

<telerik:RadGrid ID="Radshowattendedtraining" AllowMultiRowSelection="false" AllowSorting="false" runat="server" GridLines="None"

 

 

AllowFilteringByColumn="true" AllowPaging="true" AutoGenerateColumns ="false" PageSize="10">

 

 

<MasterTableView Width="100%" AllowMultiColumnSorting="false" AutoGenerateColumns="false">

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="Id" HeaderText="Id" Visible ="false" />

 

 

<telerik:GridBoundColumn DataField="Training" HeaderText="Training" />

 

 

<telerik:GridBoundColumn DataField="StartDate" HeaderText="Start Date" />

 

 

<telerik:GridBoundColumn DataField="EndDate" HeaderText="End Date" />

 

 

</Columns>

 

 

</MasterTableView>

 

 

</telerik:RadGrid>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridTemplateColumn UniqueName="TemplateDeleteColumn" HeaderText="Provided"

 

 

AllowFiltering="false" HeaderStyle-HorizontalAlign="Center" HeaderStyle-VerticalAlign="Middle"

 

 

ItemStyle-VerticalAlign="Middle" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="150px">

 

 

<ItemTemplate>

 

 

<telerik:RadGrid ID="RadshowProvidedtraining" AllowMultiRowSelection="false" AllowSorting="false" runat="server" GridLines="None"

 

 

AllowFilteringByColumn="true" AllowPaging="true" AutoGenerateColumns ="false" PageSize="10">

 

 

<MasterTableView Width="100%" AllowMultiColumnSorting="false" AutoGenerateColumns="false">

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="Id" HeaderText="Id" Visible ="false" />

 

 

<telerik:GridBoundColumn DataField="Training" HeaderText="Training" />

 

 

<telerik:GridBoundColumn DataField="StartDate" HeaderText="Start Date" />

 

 

<telerik:GridBoundColumn DataField="EndDate" HeaderText="End Date" />

 

 

</Columns>

 

 

</MasterTableView>

 

 

</telerik:RadGrid>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

</Columns>

 

 

</MasterTableView>

 

 

<GroupingSettings CaseSensitive="false" />

 

 

</telerik:RadGrid>

 

 

</asp:Panel>

 

Jayesh Goyani
Top achievements
Rank 2
 answered on 14 Sep 2011
2 answers
197 views
Hello,

I followed this tutorial to implement filter on gridbuttoncolumn:

http://www.telerik.com/community/code-library/aspnet-ajax/grid/filtering-and-sorting-for-gridbuttoncolumn.aspx

But When I click on the filter button I get the following error:

Telerik.Web.UI.ParseException: Expression expected    at Telerik.Web.UI.ExpressionParser.ParsePrimaryStart()     at Telerik.Web.UI.ExpressionParser.ParsePrimary()     at Telerik.Web.UI.ExpressionParser.ParseUnary()     at Telerik.Web.UI.ExpressionParser.ParseMultiplicative()     at Telerik.Web.UI.ExpressionParser.ParseAdditive()     at Telerik.Web.UI.ExpressionParser.ParseComparison()     at Telerik.Web.UI.ExpressionParser.ParseLogicalAnd()     at Telerik.Web.UI.ExpressionParser.ParseLogicalOr()     at Telerik.Web.UI.ExpressionParser.ParseExpression()     at Telerik.Web.UI.ExpressionParser.ParseArguments()     at Telerik.Web.UI.ExpressionParser.ParseArgumentList()     at Telerik.Web.UI.ExpressionParser.ParseIif()     at Telerik.Web.UI.ExpressionParser.ParseIdentifier()

Could you please Help on this.

PS: my version of Telerik is 2010.1.415.35
Martin
Telerik team
 answered on 14 Sep 2011
6 answers
291 views
Hi,

I am creating a dynamic raddock  then storing into database.  When I do a postback  I am  not retreiving and displaying the raddock in saved BUT on a 2nd postback it is working ok.  The bigger problem is that if I run again it should pull from database and display raddock in zones that was last saved loads the raddock in the original position.   It seems that I am missing something in _init.  
I have reviewed on-line example and forums but  have not found anything to solve my problem.  

 

<table>

 

 

 

<tr><td><asp:button runat="server" id="Button1" text="save dashboard" />

 

 

 

<br/><br/></td></tr>

 

 

 

 

<telerik:raddocklayout runat="server" enableviewstate="false" id="RadDockLayout1" onloaddocklayout="RadDockLayout1_LoadDockLayout" Skin="Web20"

 

 

 

onsavedocklayout="RadDockLayout1_SaveDockLayout" storelayoutinviewstate="false" >

 

 

 

<tr>

 

 

 

 

<td valign="top">

 

 

 

 

 

 

 

<telerik:raddockzone runat="server" id="RadDockZone1" width="402px" min-height="200px">

 

 

 

 

</telerik:raddockzone>

 

 

 

</td>

 

 

 

<td valign="top">

 

 

 

<telerik:raddockzone runat="server" id="RadDockZone2" width="402px" min-height="200px">

 

 

 

</telerik:raddockzone>

 

 

 

</td></tr>

 

 

 

<tr><td colspan="2"><telerik:raddockzone runat="server" id="RadDockZone3" Width="820px" MinHeight="200px" >

 

 

 

 

</telerik:raddockzone></td></tr>

 

 

 

</table>

 

 

 

 

</telerik:raddocklayout>

 

 

 



 

private void Page_Load(object sender, System.EventArgs e)

 

{

 

}

 

 

 

private List<DockState> CurrentDockStates

 

{

 

 

get

 

 

{

 

//Get saved state string from the database - set it to dockState variable for example

 

 

 

string dockStatesFromDB = "";

 

 

 

string loginID = "xxx";

 

 

 

string loginPassword = "xxx";

 

 

 

using (XcendaDC1DataContext context = new XcendaDC1DataContext())

 

{

 

 

var users = from u in context.tbUsers

 

 

 

where (u.U_userLogin.Contains(loginID) && u.U_userPassword.Contains(loginPassword))

 

 

 

select u;

 

 

 

var x = users.FirstOrDefault();

 

 

 

if (x != null)

 

{

dockStatesFromDB = x.U_dockState;

 

}

}

 

 

List<DockState> _currentDockStates = new List<DockState>();

 

 

 

string[] stringStates = dockStatesFromDB.Split('|');

 

 

 

foreach (string stringState in stringStates)

 

{

 

 

if (stringState.Trim() != string.Empty)

 

{

_currentDockStates.Add(

 

DockState.Deserialize(stringState));

 

}

}

 

 

return _currentDockStates;

 

}

}

 

 

 

 

protected void Page_Init(object sender, EventArgs e)

 

{

 

 

int docksCount = CurrentDockStates.Count;

 

 

 

// raddock1

 

 

 

RadDock raddock1 = new RadDock();

 

raddock1.ID =

 

string.Format("RadDock{0}", docksCount);

 

raddock1.Title =

 

"Products";

 

 

 

// raddock1.Text = string.Format("Added at {0}", DateTime.Now);

 

 

raddock1.UniqueName =

Guid.NewGuid().ToString();

 

raddock1.Width =

 

Unit.Pixel(300);

 

raddock1.Skin =

 

"Web20";

 

 

 

RadGrid gv = new RadGrid();

 

 

 

ArrayList arrListProducts = new ArrayList();

 

arrListProducts.Add(

 

"product 1");

 

arrListProducts.Add(

 

"product 2");

 

arrListProducts.Add(

 

"product 3");

 

arrListProducts.Add(

 

"product 4");

 

arrListProducts.Add(

 

"product 5");

 

arrListProducts.Add(

 

"product 6");

 

arrListProducts.Add(

 

"product 7");

 

gv.DataSource = arrListProducts;

gv.DataBind();

raddock1.ContentContainer.Controls.Add(gv);

raddock1.Commands.Add(

 

new DockCloseCommand());

 

raddock1.Commands.Add(

 

new DockExpandCollapseCommand());

 

 

RadDockZone1.Controls.Add(raddock1);

}

 

 

 

 

 

 

 

protected void RadDockLayout1_LoadDockLayout(object sender, DockLayoutEventArgs e)

 

{

 

 

//Populate the event args with the state information. The RadDockLayout control

 

 

 

// will automatically move the docks according that information.

 

 

 

foreach (DockState state in CurrentDockStates)

 

{

e.Positions[state.UniqueName] = state.DockZoneID;

e.Indices[state.UniqueName] = state.Index;

}

}

 

 

 

 

protected void RadDockLayout1_SaveDockLayout(object sender, DockLayoutEventArgs e)

 

{

 

 

List<DockState> stateList = RadDockLayout1.GetRegisteredDocksState();

 

 

 

StringBuilder serializedList = new StringBuilder();

 

 

 

int i = 0;

 

 

 

while (i < stateList.Count)

 

{

serializedList.Append(stateList[i].ToString());

serializedList.Append(

 

"|");

 

i++;

}

 

 

string dockState = serializedList.ToString();

 

 

 

if (dockState.Trim() != String.Empty)

 

{

 

 

string loginID = "myID";

 

 

 

string loginPassword = "myPassword";

 

 

 

using (XcendaDC1DataContext context = new XcendaDC1DataContext())

 

{

 

 

var users = from u in context.tbUsers

 

 

 

where (u.U_userLogin.Contains(loginID) && u.U_userPassword.Contains(loginPassword))

 

 

 

select u;

 

 

 

var x = users.FirstOrDefault();

 

 

 

if (x != null)

 

{

x.U_dockState = dockState;

context.SubmitChanges();

}

}

}

}

 

Slav
Telerik team
 answered on 14 Sep 2011
3 answers
186 views
I there.

I've a timetable in a WeekDay view. Depending on the information got from the datasource, sometimes I have more than 10 concurrent appointments for and sometimes I have only 1 or 3 appointments at the same time. In the case where I have 10 appointments I have to increase the radscheduler width but in cases I have only 1 or 3 appointments I don't want to change the width.

I don't if it is possible, but I want to in someway to resize automatically the radscheduler based in the number of appointments at the same time. 
For instance, in a weekview, if the maximum number of concurrent appointments is 2 then I would like to set the radsched width to 500px, if I have 5 concurrent appointments I would like set to 800px and if I have 10 concurrent appointments I'de like to set width to 1000px.

Is that possible? There is another approach for this problem?


Thanks




Ivana
Telerik team
 answered on 14 Sep 2011
1 answer
123 views
Hi Telerik Team,

Have you ever heard about __#!$Novalue$!#__?

One of our customers reported an error in their solution(using RTE). Sometimes when opening their content editor, the body content is missing and a __#!$Novalue$!#__  is displayed instead. See the screenshot( http://screencast.com/t/EoG3tRK2Y ).

Many thanks for your answer.

Best regards,
Anton.

Rumen
Telerik team
 answered on 14 Sep 2011
1 answer
82 views
Steps to reproduce :
  1. Open "Chrome" browser(I was not able to reproduce this behavior on IE and Firefox)
  2. Go to the  following link :"http://demos.telerik.com/aspnet-ajax/editor/examples/contentfilters/defaultcs.aspx"
  3. Select the "HTML" tab in editor 
  4. Paste following snippet into editor:  <div style="background-image: url(/~/image/picture.jpg);">text</div>
  5. Select the "Design" tab and then again select "HTML" tab

As a result you will have the following:
<DIV STYLE="BACKGROUND-IMAGE: URL(HTTP://DEMOS.TELERIK.COM/~/IMAGE/PICTURE.JPG);">TEXT</DIV>

Editor adds the host name to url.

Why after switching between tabs("Design" and "HTML") the host name was added to the url , and how can I prevent such a behavior? 
Rumen
Telerik team
 answered on 14 Sep 2011
1 answer
155 views
I'm using a radtextbox to Insert and Edit a data table. Inserts are fine, but when calling a page to edit the page should appear with the data already available in the textbox to edit. Everything is fine up to this point, but when editing data the original value seems as though data do not change. For example...page load with original value in textbox "Item 3" and i wanted to edit the textbox to "Item 4" even though "Item 4" appears within the textbox on screen in code behind "Item 3" is being passed. I searched the properties on the client and _initialValue = "Item 4" which is what i want and value = "Item 4" still good, but defaultValue = "Item 3" and it appears as though this is what is being passed in code behind. I tried to explain this as best as possible, I know it maybe confusing but any help would be appreciated.

Thanks,
Ron.
Tsvetina
Telerik team
 answered on 14 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?