473,654 Members | 3,060 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Limit a gridview to one column only...

Hello,

The aexview is showing four or five columns and most of the time only one or
two is (are) useful in our environment Also the view is too big for our usual
screens so I would like :
- to hide some column from this view if possible
- to create a listview of the same field but limited to the field needed

What is the best way to approach this? Is this possible without changing too
many screens?
I have tried :
<tr>
<td align="left" class="listview-item"><%#
DataBinder.Eval (Container.vRep ort, "Name") >
</td>
</tr>

but for now I am getting an error:
The following error occurred on the page 'Copy of ItemListView.as px':
Object reference not set to an instance of an object.

Exception Trace:
System.NullRefe renceException: Object reference not set to an instance of an
object. at Altiris.NS.UI.I temListView.Pag e_Load(Object sender, EventArgs e)
at System.Web.UI.C ontrol.OnLoad(E ventArgs e) at
System.Web.UI.C ontrol.LoadRecu rsive() at
System.Web.UI.P age.ProcessRequ estMain()What did I miss? A Namespace?

Where should the class="listview-item should be defined? I think I have an
error already on this?

I have added:

<%@ Assembly Name="System.Wi ndows.Forms.Con trol" %>

to try to use the ListView control as:

<td>
<asp:ListView id="listView" runat="server"> </asp:ListView>
</td>

but it is giving me an error before adding the Namespace:
Parser Error: Could not load type
Altiris.NS.UI.C ontrols.ViewCon trols.ListViewC trl from assembly Altiris.NS.UI,
Version=6.0.607 4.4, Culture=neutral , PublicKeyToken= d516cb311cfb6e4 f.

or

after adding the Namespace:
Parser Error: File or assembly name System.Windows. Forms.Control, or one of
its dependencies, was not found.
<%@ Import Name="System.Wi ndows" %>
<%@ Import Name="System.Wi ndows.Forms" %>
<%@ Import Name="System.Wi ndows.Forms.Con trol" %>
.....

When trying to add the Namespace as import I am getting the following error:
Parser Error: The 'Name' attribute is not supported by the 'Import'
directive.

What could be the correct syntax?

thanks,
--
Dominique
Aug 15 '06 #1
0 1392

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3032
by: Nalaka | last post by:
Hi, I have a gridView (grid1), which as a templateColumn. In the template column, I have put in a gridView (grid2) and a ObjectDataSource (objectDataSource2). Question is... How to I pass the current_row_key of Grid1... to the objectDataSource2 parameter? (so that the second grid, gets only the information to do with current row of grid1)
4
5090
by: Hans Merkl | last post by:
Hi, Is there a way to show the column headers of a GridView control even if there is no data? The only thing I see is the EmptyDataTemplate but I would also like to display the column headers. Thanks Hans
7
14802
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I want to look at that data and filter it based on what is in it. I know that this could have been done with data sets and data views in asp.net 1.1 but how is this done now in asp.net 2.0?
1
3537
by: Eric | last post by:
I have a GridView control that I want to sort on multiple columns when I click a particular column. For example, I display Last name + ", " + First name in the first column and display id in the second column. When clicking on the first column, I want the GridView to sort on LastName and FirstName. Based on Microsoft's documentation of SortExpression property, all I have to do is to set SortExpression=LastName,FirstName on the first column....
5
6436
by: sutphinwb | last post by:
Hi - This could be a simple question. When I relate two tables in a datasetet, how do I get that relation to show up in a GridView? The only way I've done it, is to create a separate table in the dataset with a join query for the GetData() select method. I use ObjectDataStore to couple the GridView with the table adapter on the dataset. If I point the ODS at the child table, the GridView will bind to the "normal" select and I end up...
3
3544
by: Gunawan | last post by:
Dear All, I have data which display on the GridView. GridView contain 3 Column (ProductId, ProductCode and Description). I would like to display only Product Code and Description so I hide ProductId Column. Is there any command so I can take value of first column which is Product ID? In other words, how can I get value from hidden column on Grid View? TIA,
1
3875
by: =?Utf-8?B?UGF0cmljayBG?= | last post by:
I have a gridview on the page that i want to dynamically populate with radiobuttons, so i went out on the net and found something that works perfectly, it created radionuttons and the postback with the works. My problem is that i want to send 2 columns to the gridview instead of 1, but i cant figure out how to add the second column to the gridview. <asp:GridView ID="GridView1" AutoGenerateColumns="false" runat="server" ShowHeader="false">...
1
6722
by: Jeff | last post by:
ASP.NET 2.0 I've got problems with the right column in my GridView. The GridView consist of 2 columns, the problem column is the column on the right side. The problem is that it looks like there is a huge space between the 2 columns, see the huge grey space between the 2 columns. I want the columns to be very close to each other with only 10px open space between the columns. Now it looks like there is a 160px margin between them
5
23620
by: NKaufman | last post by:
<asp:GridView ID="Basic" runat="server" DataKeyNames="QuestionID,isHeading" AutoGenerateColumns="false" AllowPaging="true" PageSize="100"> <Columns> <asp:BoundField Visible="false" DataField="QuestionID" HeaderText="QuestionID"></asp:BoundField> <asp:BoundField DataField="QuestionDesc" HeaderText="Question" ItemStyle-HorizontalAlign="Left"></ asp:BoundField>
4
4214
by: Randy Smith | last post by:
Hi, I would like to limit my user selection to only one row in the GridView at a time. Is there any way to set this? TIA, Randy
0
8294
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8709
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8494
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7309
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5627
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4297
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2719
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1924
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.