column

Making a DataGrid Column Header sortable in WPF using C#

I am using C# in Visual Studio 2008 and I have install the WPF Toolkit. I created a DataGrid in testtest.xaml. The ID and Parts $ columns have the ability to sort the DataGrid by clicking on their respecteive column headers. However, the column header Complete Date does not have that ability. I used the tag "DataGridTemplateColumn" t...

How do I get column name from rowselection in an ExtJS grid?

I have a extjs gridpanel setup, and I want to be able to do things based on a user clicking on text or icons in the grid. For example, filter the grid if the user clicks (or double clicks) a word in a column, or show a popup if the user clicks on an icon. I can easily get the row they clicked on, and values by column name from that row, ...

How long does it take to create an identity column?

I have a table that have 40million records. What's best (faster)? Create a column directly in that table or create another table with identity column and insert data from first? If I create an identity column in the table that have 40million records, is it possible estimate how long does it take to create it? ...

Databinding the DataGrid column header in code

How do I databind a WPF Toolkit DataGrid column header value in code (not XAML)? DataGridColumn fooColumn = new DataGridTextColumn { Header = "Foo", Binding = new Binding {Path = new PropertyPath("BindingPath"), Mode = BindingMode.OneWay} }; This databinds the content of the cells of the column. But ho...

SQL how to find non null column?

I have a table with lots of columns, say I have columns A, B, C, D in each of these columns, only one column in any one record will be filled and the others will always be NULL. I need a select statement that will return the Column of the non null Column. I've tried coalesce, but this return a value, not the column to which the ...

Cannot group by bit column

In sql server 2005, i in the query builder, i select "Add group by" to automatically add the group by clause to all of the fields i selected. If one or more of those fields are a bit type, i get an error. Why is this? Is casting the column to TINYINT a good fix? ...

How to use C# to add a column for a table of sql server?

How to use C# to add a column for a table of sql server? For example, I want to execute the following sql in C# code: alter table [Product] add [ProductId] int default 0 NOT NULL ...

How to write sql to set alter a column's default value in sql server 2005?

I have a table [Product] with a column [CreateTime] datetime null, and is has some data already. How can I set the column [CreateTime] 's default value to getdate(), and make the new added data to have a default value getdate() for column [CreateTime]. ...

Nvarchar or varchar what is better use multiply of 2 or rounded full numbers??

Hello, My question is what is better to use in generating columns in SQL. Should the size of nvarchar (varchar) be multiply of 2 (32, 64, 128) or it's doesn't matter and we can use fully numbers example '100', '50' ? Thank You very much for answers with reasons Greeting's to all ...

Why are Oracle table/column/index names limited to 30 characters?

I can understand that many years ago there would be this kind of limitation, but nowadays surely this limit could easily be increased. We have naming conventions for objects, but there is always a case that turns up where we hit this limit - especially in naming foreign keys. Does anybody actually know why this isn't a bigger size - or ...

Database name convention: DATETIME column

What is your naming convention for DATETIME columns (in my case, using MS SQL Server) For a column that stores when the row was created CreatedDatetime makes sense, or LastModifiedDatetime. But for a simple table, let's say one called Event, would you create columns called: EventID, // Primary key EventDatetime, ...

How to Alter Column Data Type Without Affecting Existing Column Width

Hi Folks, I have an existing column of data type varchar that I need to change to nvarchar, however I do not want to alter the existing column width of (5). If I use the following statement ALTER TABLE MYTABLE ALTER COLUMN MYCOLUMN NVARCHAR (5) NOT NULL I end up with a column of nvarchar data type, but with a column width of (10)!...

Data-bind a column to a collection

I have multiple Users, each with a collection of Tasks. public class User { public string Name { get; set; } public IEnumerable<Task> Tasks { get; set; } } public class Task { public string Name { get; set; } } What I would like to do in Silverlight is have each User represented as a column, with Tasks represented as item...

What is the proper CSS way to implement right-aligned text on table columns?

To my surprise I just found out that applying text-alignment to a table column is fairly bad supported in current browsers. Neither Firefox 3.5.2, Safari 4.0.3 or IE8 shows the "amount" column below as right aligned. HTML: <table class="full_width"> <caption>Listing employees of department X</caption> <col></col> <col></col> <c...

Gridview - Adding of column

Hello, My question is: Can I add in new column(S) in the gridview if the column is not found in the database? - E.g. An indicator if a certain lecturer is a ML/Lec (roles). I have a gridview that is "extracted" out from the database. But I want to add in a new row which is not in the database but links to the data in the database. Fo...

WPF : GridViewColumn.Header drag (reorder) problem

In my WPF Application I have an GridViewColumn that looks like this: <GridViewColumn Width="170"> <GridViewColumn.Header> <StackPanel Orientation="Horizontal"> <Path Data="{StaticResource pathStar}" Fill="Gold" Stroke="Red"/> <TextBlock VerticalAlignment="Center">New items</TextBlock> </Stack...

How to get value of dynamicaly added column of datagridview at time of postback!!

Hello, I have made a one form with functionality to create grid view dynamically. i have used concept of "how to create template columns dynamically in a grid view" Link : http://www.codeproject.com/KB/aspnet/DynamicTemplateColumn.aspx its working good. i am creating control run time set the different property of control and bind it...

column access with multidimensional array in php

I have a 2-D array of integers. I'd like to initialize it in column order, and then access it in row order. Is it possible to initialize in PHP in column order without explicitly iterating over every row? For example, in R, one can do my2d = matrix(nrow=2, ncol=2) # create 2x2 matrix my2d[,1] = c("a","c") # initialize column 1 in a s...

Can a MySQL SELECT statement work without specifying column names?

How do I SELECT rows and return all the columns, instead of specifying individual column names? Can I also return only columns that match a specific criteria? (eg. col names beginning with an "_") ...

To Append a column in a jtable modifying its width

Hello there, I'm trying to add a column to a jtable. I've tried this code: DefaultTableModel model = (DefaultTableModel) table.getModel(); model.addColumn("new column"); but the width of the table doesn't change, but the columns width. In other words, the width of the columns reduces so the new column "fits in" the table, but what I wa...