.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
SP
satyapriyanayak
Subhransu Sekhar Jena
abhays
DotnetUser
Post New Web Links

How to apply View filtering with FilterField and FilterValue parameters by default

Posted By:      Posted Date: November 01, 2010    Points: 0   Category :SharePoint
 

Hello,

My list's default View (AllItems.aspx) displays a column 'Status', and I would like to automatically filter this column by default so that when a user navigates to AllItems.aspx, this column filter is already applied.

In other words, in my view AllItems.aspx, if a user clicks on the column header for 'Status' in the list view to only show Active items, the list url would be AllItems.aspx?FilterField1=Status&FilterValue1=Active

Can anyone suggest how I could automatically add the URL parameters FilterField1=Status&FilterValue1=Active to my AllItems.aspx automatically whenever this view is loaded? Perhaps could I set these variables on page load via Javascript or JQuery? Ideally I would like to 'intercept' the page, check if these parameters are undefined and if so then set them, rather than posting back. 

I realise I could achieve the same result by just editing the View query to filter on Status equals Active, however like this the user can choose to clear the Status filter if they want to without the need to edit the View's query.

Thanks


Nicholas Demos


View Complete Post


More Related Resource Links

view state vs request parameters

  

If  the view state is the data entered into the form fields then they are supposed to be available in the request parameters or request body. Then why would we need view state for?


Thanks.



Disable filtering on a Dynamic Data list view.

  

I have an entity set of NotificationTemplates, and each one of these has a collection of zero-many SmsTemplate entities. When editing or viewing a NotificationTemplate, I have a link to View SMS Templates. That link takes me to a List view for the SmsTemplates entity set, filtered for the NotificationTemplate I was viewing.

How can I prevent the user changing this filter to show SmsTemplates for another NotificationTemplate? That is, I want the filter, but it must be read only. The drop-down just mustn't drop down, it must just display the name of the NotificationTemplate that these SmsTemplates belong to. To view SmsTemplates for another NotificationTemplate, the user must click View SMS Templates from that other template.


This was originally asked by myself on SatckOverflow at: http://stackoverflow.com/questions/3514373/disable-filtering-on-a-dynamic-data-list-view



Personal view reverts back to default after updating properties of item

  

I am working with a company that has 1 site collection with several sub sites.  I have built 3 document libraries with workflow in 3 different sub sites and all behave as expected.  I have one site where ALL libraries do something perplexing;

If you are in a custom personal view and you go into the properties of a document and then exit (update or not, does not matter) it reverts back to the default view of that library. 

Has anyone seen this?  is there an option when creating an album that could cause this?

thanks in advance for any input on this odd issue.


When i click on any other folder in the document library that will navigate to default view of DL?

  

Hi

I have document library with having some folder in the same ,i have displayed my library in the page as Treeview, so when i click on any of the folder in the library i need to navigate allitems.aspx page i.e default view page of the document library ,the document library having views.Suppose when i am in other view i have selected folder from library treeview folder is changing but view not navigate to default view.

pls help 

 


When the user want click on document library that should be navigate default view

  

Hi

I have document library which is having folders,the document library i have displayed as tree view in the left side of the page.

Here Document library having views,suppose i have selected one view on the document library it is navigating the particular view that is good but when i am trying to click document library folder still the page in same view do not navigate the default view .

I need when ever i click on any of the folder in document library that should navigate defualt view ,could you please help me on this.

Really its need urgent...

thanks


Replication stored procedures not being passed parameters- default appears instead

  
Hi I am setting up transactional replication from Oracle to SQL Server, it is working fine for 9 tables, but for one it fails on updating and deleting with a message like this: Procedure or function 'spu_VGSM_SUBMISSION_CONTACT' expects parameter '@pkc1', which was not supplied. This is correct, in that the sp should be being passed this parameter, but when I do a trace it will show something like: exec "spd_VGSM_SUBMISSION_CONTACT" '12-3456-10','BLOGGS','S', '2010-07-01 12:43:43', 'M123456' default In other words, the old primary key values which should be being passed in are being replaced with "default". I am using the CALL syntax for the update sp. If anyone can suggest why this is I would be very grateful. This is the publication: exec sp_addpublication @publication = N'_Submission_Contact', @description = N'Transactional publication from Oracle Publisher.', @sync_method = N'concurrent_c', @retention = 0, @allow_push = N'true', @allow_pull = N'true', @allow_anonymous = N'false', @enabled_for_internet = N'false', @snapshot_in_defaultfolder = N'true', @compress_snapshot = N'false', @ftp_port = 21, @ftp_login = N'anonymous', @allow_subscription_copy = N'false', @add_to_active_directory = N'false', @repl_freq = N'continuous', @status = N'active', @independent_agent = N'true', @immediate_sync = N'

How to add WebMatrix default parameters?

  
That subject may not do this questions justice.I am trying to limit what I write on all my .cshtml pages.For example, on everypage I am @using myDLL and "connecting" to sql server.I write that out like @using System.myDLL; @{ myDLL dll = new myDLL(); dll.ConnectionString = "blablabla"; } How can I remove the need to do that to every single page? I think I can create a web.config and do some funky stuff... can someone show examples?

How to pass page column value to data view parameters

  
Hi All, I have a page library with custom column, lets call it "FormCourseId". On that page I have data view which retrieves data from custom list filtered by page column "FormCourseId". In parameter wizard creates the following tag <ParameterBinding Name="ListCourseId" Location="Form(FormCourseId)" DefaultValue=""/> Then I try to use that parameter in XSLT of data view as a filter creteria.  <xsl:param name="CourseId"></xsl:param> It does not work for me. If I change data view parameter source from Form to Query String and pass parameter as url one it works fine. What is wrong with page column parameter binding? May be if FormCourseId column is not presented in form layout as a field(I do not need to show that field in user form of the page) it could not be treated as form parameter?

Load View and Partial View (Master/Detail) with default parameter(s) ?

  
MVC newb.  Members view (index) that lists members that users can select to show a partial view in the same view with details for the selected member Uses jquery (Ajax.ActionLink) to call a partial view method in the members controller to then load the members detail section Works fine up to here....but I'd like to load the partial view with "member" details for a default or random member on initial load -- ie not through the Actionlink selection How do I invoke the partial view method on the initial load?  I'm sure this is basic stuff but still still getting my head around the mvc "way" Can someone point me to an example or explanation somewhere?  (not turning anything up on my searches thus far)   thanks in advance!!

How to apply dynamic filter in Datasheet View from Query String

  
The datasheet view doesn't support either connections/dynamic filters from Query string. How to filter the data using query string?

Data View and Scheduled Start & End Dates Filtering

  
I have a data view that needs to display all pages that are current and the closing date is greater than or equal to today's date. The issue I am having is that the data view is displaying pages that are have the a future scheduled start date or the scheduled end date is past, i.e. something that has a start date of tomorrow, is displaying and a page that has an end date of yesterday is displaying. I can tried to filter the data view on the scheduled start and end dates but I can't see it in the Filter Options of the 'Common Data View Tasks'. I have also tried adding XSLT Filtering but am unsure how to set it up.  I have added the following as an XSLT filtering [@PublishingStartDate<=$Today or string-length(@PublishingStartDate)=0] I am wanting to check whether I have done this correctly or not. Some pages won't have a scheduled start date but all will have an end date. Below is the code from my data view: <WebPartPages:DataFormWebPart runat="server" ShowWithSampleData="False" AllowRemove="True" AllowHide="True" SuppressWebPartChrome="False" PartImageLarge="" ViewContentTypeId="" ExportMode="All" Dir="Default" MissingAssembly="Cannot import this Web Part." ID="g_fdf00570_38e8_4df9_8ab3_5ca3ed974c41" DataSourceID="" IsIncludedFilter=""

InfoPath 2010 Not Allowing Default Parameters Anymore?

  
It appears that InfoPath 2010 no longer allows you to set the default parameter values for secondary WebService data sources before they are automatically called during the form startup. When you set up a secondary data source to a standard web service call that takes parameters, you get prompted for the sample values.  However, when you run the form, these sample values are not sent to the web service, as you would expect. Furthermore, because the secondary datasource is automatically called when the form starts up, you are not able to set the values before the automatic call because the rules processing occurs AFTER the initial call to the web service. I realize that I could do this in code in the Startup routine, but the problem is that we have users who want to stay away from coding and want to use the functionality of InfoPath and it's "easy to use interface" to be able to create forms.   Now I have to tell them that they need to start to learn C#? Am I doing something wrong here?    Or is this a big oversight on this release of InfoPath? Microsoft: If you are listening...could you please comment on this?   I would consider this a bug.

Error Creating Indexed View with APPLY

  

Hi All,

I got a requirement to create a view with current months qty, value and same month last year qty, value

Im facing a issue when im trying to create a Index on a view which created using table-valued function. following is a script I used to create the view followed by script to create index on that view.

 

 

CREATE VIEW vSales WITH SCHEMABINDING AS
SELECT 
	CurrentMonth.PeriodYear,
	CurrentMonth.PeriodMonth, 
	CurrentMonth.Product,
	CurrentMonth.CurrentMonthQty,
	CurrentMonth.CurrentMonthVal,
	LastYear.Qty,
	LastYear.Val,	
FROM (
	SELECT dbo.Table2.PeriodYear,
		  dbo.Table2.PeriodMonth, 
		  dbo.Table3.Product,
		  SUM(dbo.Table1.Qty) CurrentMonthQty,
		  SUM(dbo.Table1.Val) CurrentMonthVal
	FROM dbo.Table1, dbo.Table2, dbo.Table3
	WHERE dbo.Table1.DateCol = dbo.Table2.DateCol
	AND dbo.Table1.ProductCol = dbo.Table3.ProductCol
	GROUP 

how to restore view style to default... urgent

  

dear friends,

I have changed default font size of '.ts-syslabl' in view style of "Boxed" for a page. But it is reflecting in all view styles. May be i corrupted main css core file or vwstyles file with respect to that site collection. How to restore to default file with respect to css. Kindly help me out . It is urgent ...please.. It is the problem with only one site collection in which i tried.

I used Sharepoint designer 2010 .

pleasehelp me out


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend