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


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

Filtering a grid column when the column is bound to a collection

Posted By:      Posted Date: August 25, 2010    Points: 0   Category :ASP.Net
 

My SetUp (I am using EF for my data):

1 Grid bound to a collection of Vehicle Objects

1 Combobox with multiselect enabled bound to a list of VehicleExtras.

Each vehicle has a collection of extras. 

My Problem:

What I need to do is have the Grid filter Vehicles based on whether those vehicles have the selected VehicleExtras from the Combobox


Can anyone point me in the right direction as to how this filtering should be done (if it is at all possible!)


Regards,


Dave




View Complete Post


More Related Resource Links

Pass a grid column value to a Modal

  

Hi, I have a requirement to hide a field called details on a gridview and show it in a jQuery modal dialog when users click on the Customer ID hyperlink. This grid is created programmatically. I will be hiding the details column via the CSS display:none property. Does some one know how can I pass the grid's selected hidden column value to the modal? Here is some of the code I started:

            GridView mygrid = new GridView();
            //.....................................More columns code for the grid

            //Here is where I need to pass the Details column value associated with the customer ID field selected to the Modal and open the Modal dialog.            
            HyperLinkField linkField = new HyperLinkField();
            string[] dataNavigateUrlFields = { "CustomerID" };
            linkField.DataTextField = "CustomerID";
            linkFi

Grid Column in Sharepoint.

  
I need to create a grid column type for sales team of my company: Please have a look at following image. Grid column type in above example - this column type is just making single choices on each row - I need something which can allow various types of columns inside the grid more like a table. So that I can have columns like Qty(number), Cost(number), From Dept(drop-down), To Dept (drop-down) as column heads against the products - so all info of the products can be inside a single column (instead of multiple items in a list) and yet the info is linked row-wise i.e. qty in first row belongs to product 1 - they are linked for the purpose of filtering records later on. By the way, the responses of this form are saved in a spreadsheet like any normal google form - will email the link to this spread sheet as well. Is this possible? Are there any column features or webparts available for same? Apreciate all help!. -saumil

SOLUTION: Renaming the Title list column globally across the site collection

  
So, you screwed up like I did, and modified the Title display name of the Item base content type and it has renamed ows_Title across every list in your site collection? Here's how you fix it: //WARNING //If you have come this far, be aware that this tool is a blunt axe. With it, you can cause //all sorts of mayhem and chaos in your site collection. So, to use this, you must be desperate. //or possibly dumb. Apparently, I'm just as dumb as you, because I did it. This is why I wrote //this stupid thing, so stupid people like us can go right on being stupid. //Your choice of weapon in this battle amuses me. Shall we begin? using System; using System.Collections.Generic; using System.Text; using Microsoft.SharePoint;   namespace RenameField {     class Program     {         static void Main(string[] args)         {             if (args.Length < 3)             {                 Console.WriteLine("Usage: RenameField <url-to-sitecollection> <internal-field-name> <new-fieldtitle>");               &n

Hide grid view column if empty

  
 Hello All, I want to hide a grid view column if that column is empty. How do I do this? I dont have much exp. with grids. Please help me. Thanks in advance.

How to convert the datagrid bound column item itself link to another detail page without using hyper

  
Dear experts, I would like to make the datagrid bound column to redirecting to the details page . For example , when my mouse over certain row of bound column in datagrid , it will change the colour to blue . Also , I can click anywhere of the row and the will redirect to the detail page . Can any expert help me on that ? Notes : I do not want to use hyperlink column and do not want to fix the text for every row. I want to use datafield, CommandName and CommandArguement. Thanks & Rgds

Need help on Select button column in Data Grid to populate fields in Form View

  

 When I have a select a row in a Data Grid that when I click on it I want it to show the info for the person I selected in a form view on the same page as the Data Grid. Here are the columns for the Data Grid that I have set up, the column is highlighted:

<asp:DataGrid ID="MHGrid" AutoGenerateColumns="False"  
        DataSourceID="MHFoundation" DataKeyField="POPULATION_LIST_ID" 
        AllowPaging="True" AllowSorting="True" BorderStyle="Solid" 
        BorderColor="#999999" BorderWidth="3px" CellPadding="4" PageSize="4" 
        CellSpacing="2" runat="server" BackColor="Gray" Font-Bold="False" 
        Font-Italic="False" Font-Overline="False" Font-Strikeout="False" 
        Font-Underline="False">
        <SelectedItemStyle BackColor="#FF9900" Font-Bold="False" Font-Italic="False" 
            Font-Overline="False" Font-Strikeout="False" Font-Underline="False" />
        <Columns>
            <asp:ButtonColumn CommandName="Select"  Text="Select"></asp:ButtonColumn>
            
            <asp:BoundColumn D

WPF Data Grid - How to hide the next column/row that is visible?

  

I'm using a WPF data grid to bind to an object (i.e. not a database). I have the horizontal alignment on Stretch. I currently have it within a Border, which is within a Grid.

However when I run the application the DataGrid has a blank column and grid showing. That is say I have 5 columns & 5 rows, then there is a blank 6th column and row showing. See image:

alt text

Question - How can I get rid of these blank rows? Note that the contents of the DataGrid are populated programmatically (i.e. are not static).

thanks


WPF Data Grid - How to hide the next column/row that is visible?

  

I'm using a WPF data grid to bind to an object (i.e. not a database). I have the horizontal alignment on Stretch. I currently have it within a Border, which is within a Grid.

However when I run the application the DataGrid has a blank column and grid showing. That is say I have 5 columns & 5 rows, then there is a blank 6th column and row showing. See image:

alt text

Question - How can I get rid of these blank rows? Note that the contents of the DataGrid are populated programmatically (i.e. are not static).

thanks


problems with filtering managed metadata column

  

I like managed metadata in many way, but there´s several things I can´t get "right":

- In a document library I have managed metadata columns. If i filter with one column (say I filter Europe in column Continents) , every other column take´s away unrelevant filtering options (Country column should only show European cuntries) , except the  managed metadata columns, wich show everyting. Why? Can I change that?

- I have a long list of terms in a managed metadata column. When I try to filter that column, I have to press "more" severel times to get the term I want to filter on. Is it posible to see all terms at ones or se more that 20 terms before I have to click on "more"?

Thanks for helping me,

David


How to Disable Specific Column in Data Grid View and write something in Cell and load data in anothe

  

Hello All  ,

i have data grid view and i want to disable specific column from writing in it and in another column 

i want to write something like item code and load the item name automatically in the corresponding cell in the disabled column 

i hope that i write my problem correctly and you can understand what i want :)

thanks in advance ,


Kareem Naguib

DataGrid - how to make Column sorting dynamic, to cater for when bound data changes?

  
I'm using a DataGrid in a VS2010 WPF C# project.  I have bound the DataGrid to an ObservableCollection<SummaryItem>.  When you click on a column heading it sorts the data at that point in time.

Question - How would I arrange such that the sorting in the DataGrid is dynamic, so that when data changes (within the ObservableCollection<SummaryItem>) the sorting keeps working.

Notes: Binding approach is via DataGrid

      private ObservableCollection<SummaryItem> _summaryData = new ObservableCollection<SummaryItem>();
      SummaryDataGrid.ItemsSource = _summaryData;
  
      SummaryDataGrid.AutoGeneratingColumn += (s, e) =>
      {
        //if (e.Column.Header.ToString() == "ProcessName")
        //  e.Column.Width = new DataGridLength(1, DataGridLengthUnitType.Star);
        e.Column.Width = new DataGridLength(1, DataGridLengthUnitType.Star);
      };
  
  
  
  public class SummaryItem : INotifyPropertyChanged
  {
    public event PropertyChangedEvent

How to Format Data inside a Bound Column of Gridview?

  

Hello,

I have a bound column.

<asp:BoundField DataField="WorkPreference"  HeaderText="WorkPreference"
                    HeaderStyle-HorizontalAlign="Left">
                    <HeaderStyle HorizontalAlign="Left" />
  </asp:BoundField>

dr["WorkPreference"] = sa.WorkPreference ( This is how I bind the data  to a DataRow)


The example of the data which gets bound to this column is like the following:

Communications and Marketing Officers; Environmental Assessors; Geologists and Geosciences; Geospatial/Spatial Information Officers;

What I want is that the data should be presented to the user like the following:

Communications and Marketing Officers

Environmental Assessors

Geologists and Geosciences

Geospatial/Spatial Information Officers


In short: I basicaly want to put a break where there is a colon and then bind the data to the gridview.

It looks like simple but if you can let me know. Thanks.





How to select column value from grid and hide a column?

  

Hello,

I'm trying to retreive a column value from gridview5 to use it in a query to display resuls in gridview, can you please help me with the code below. Also how do you hide a column in the grid?

Where (p.Link_ID Like GridView5.?????)

Dim DB As New AOP29DBDataContext

Dim Query = From p In DB.Link_Tables _

Where (p.Link_ID Like GridView5.Columns("link_ID")

Select p.Receiver.Receiver, _

p.Donor.Donor, _

p.BM.BM()

GridView4.DataSource = Query

GridView4.DataBind()


Lookup column across site collection that are in different content DB

  
Is there any solution to create a custom look up column that get the data from lists in different site collection that are different content DB?

cross site, within collection, Lookup column

  
Is it possible, through the UI or with  Designer 2007, do create a Lookup column that gets its data from another site within the same site collection?  If not, can you recommend any FREE third party tools to do this?  Thank you.
There are no mistakes; every result tells you something of value about what your are trying to accomplish.

DFWP query string parameter breaks column header filtering?

  

Hi,

We have created a page (using SPD) which accepts a query string parameter to set the data filter for the DFWP. The data is displayed with a basic table layout and "sorting and filtering on column headers" is enabled. But it appears that only the sorting works. When a user clicks on the drop-down for a column header, "Ascending", "Descending", and "Loading..." is displayed. After a few seconds, "Loading..." changes to "Clear Filter" (disabled) but there is no distinct list of values to select as a filter. If we remove the query string parameter from the underlying DFWP query, it works fine. Has anyone else noticed this behavior and/or have a solution?


The ManyToMany template does not support the collection type of the 'SourceViews' column on the '

  

I am getting this error: The ManyToMany template does not support the collection type of the 'SourceViews' column on the 'LocationSet' table.

Line 28: if (entityCollection == null)
Line 29: {
Line 30: throw new InvalidOperationException(String.Format("The ManyToMany template does not support the collection type of the '{0}' column on the '{1}' table.", Column.Name, Table.Name));
Line 31: }
Line 32: if (!entityCollection.IsLoaded)
Source File: ...\Admin\DynamicData\FieldTemplates\ManyToMany.ascx.cs    Line: 30

I am using VS 2010 and ASP.NET 4.0.  I am using Code First to create 2 classes with a many-to-many relationship between the 2 classes, which generates 3 tables.  I am using DynamicData to manage the tables and getting the error when trying to view either of the 2 tables in DynamicData List.aspx page.  Below is the relevant code for my classes.  The 3rd table that is generated is a simple table with 2 fields:  SourceViewId and LocationId.  Any ideas?

public class SourceView
{
[Key]
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