Click here to Skip to main content
15,917,538 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionRe: Able to stop FireFox loading pages twice. Any thoughts as to why? Pin
Bill Lawton18-Mar-09 9:55
Bill Lawton18-Mar-09 9:55 
AnswerRe: FireFox loading my pages twice. No Images exist, AutoEventWireup is false - Code included. Pin
rajmca.g18-Mar-09 19:50
rajmca.g18-Mar-09 19:50 
AnswerRe: FireFox loading my pages twice. No Images exist, AutoEventWireup is false - Code included. Pin
JacquesDP18-Mar-09 22:22
JacquesDP18-Mar-09 22:22 
GeneralRe: FireFox loading my pages twice. No Images exist, AutoEventWireup is false - Code included. Pin
Bill Lawton19-Mar-09 5:50
Bill Lawton19-Mar-09 5:50 
Questionon the fly adding DataFormatString to a TableCell in a GridView Pin
Herman<T>.Instance18-Mar-09 6:54
Herman<T>.Instance18-Mar-09 6:54 
AnswerRe: on the fly adding DataFormatString to a TableCell in a GridView Pin
tech60318-Mar-09 13:59
tech60318-Mar-09 13:59 
GeneralRe: on the fly adding DataFormatString to a TableCell in a GridView Pin
Herman<T>.Instance19-Mar-09 2:46
Herman<T>.Instance19-Mar-09 2:46 
GeneralRe: on the fly adding DataFormatString to a TableCell in a GridView Pin
Herman<T>.Instance19-Mar-09 5:29
Herman<T>.Instance19-Mar-09 5:29 
Having it fixed

This is the trick
1. Determine for each gridviewcolumn its headertext
2. Determine for each cell in the row.cells if the cell.ContainingField.HeaderText equals the headertext found in the previous gridviewcolumn
3. If the value of an item in the array of the datarowview with (yeah I know it can be buggy) the cell.text value you have found it
Than determine the type of the dataRowView[x] and fill cell.text with the formatstring in the Database.

Anyone a better solution ?

see my code:

public static GridViewRow MaakGridViewRowOp(GridViewRow row)
{
    GridView grid = (GridView)row.NamingContainer;
    DataRowView dataRow = (DataRowView)row.DataItem;
    foreach (DataControlField column in grid.Columns)
    {
        foreach (DataControlFieldCell cell in row.Cells)
        {
            if (column.HeaderText.Equals(cell.ContainingField.HeaderText)
               && !String.IsNullOrEmpty(column.HeaderText))
            {
                //Start with 1 because 0 is DataKeyValue and not shown in GridView
                for (int celwaarde = 1; celwaarde < dataRow.Row.ItemArray.Length; celwaarde++)
                {
                    if (cell.Text.StartsWith(dataRow[celwaarde].ToString(),
                       StringComparison.OrdinalIgnoreCase))
                    {
                        if (dataRow[celwaarde].GetType().Equals(Type.GetType("System.DateTime")))
                        {
                            DateTime datum = Convert.ToDateTime(dataRow[celwaarde]);
                            cell.Text = datum.ToString(MSBNZBLL.ParameterString.
                                    SysteemParameters.GetParameterAsString("DatumTijdFormat"));
                        }
                        else if (dataRow[celwaarde].GetType().Equals(Type.GetType("System.Decimal")))
                        {
                            Decimal getal = Convert.ToDecimal(dataRow[celwaarde]);
                            cell.Text = getal.ToString(MSBNZBLL.ParameterString.
                                    SysteemParameters.GetParameterAsString("VerwerkteMetingFormat"));
                        }
                        else if (dataRow[celwaarde].GetType().Equals(Type.GetType("System.Int32")))
                        {
                            Decimal getal = Convert.ToDecimal(dataRow[celwaarde]);
                            cell.Text = getal.ToString(MSBNZBLL.ParameterString.
                                    SysteemParameters.GetParameterAsString("VerwerkteMetingFormat"));
                        }
                        else if (dataRow[celwaarde].GetType().Equals(Type.GetType("System.Int16")))
                        {
                            Decimal getal = Convert.ToDecimal(dataRow[celwaarde]);
                            cell.Text = getal.ToString(MSBNZBLL.ParameterString.
                                    SysteemParameters.GetParameterAsString("VerwerkteMetingFormat"));
                        }
                        else if (dataRow[celwaarde].GetType().Equals(Type.GetType("System.Int64")))
                        {
                            Decimal getal = Convert.ToDecimal(dataRow[celwaarde]);
                            cell.Text = getal.ToString(MSBNZBLL.ParameterString.
                                    SysteemParameters.GetParameterAsString("VerwerkteMetingFormat"));
                        }
                        break;
                    }
                }
            }
        }
    }
    return row;
}


In Word you can only store 2 bytes. That is why I use Writer.

QuestionProblem with my windows service [modified] Pin
gottimukkala18-Mar-09 6:30
gottimukkala18-Mar-09 6:30 
AnswerRe: Problem with my windows service Pin
Herman<T>.Instance18-Mar-09 6:48
Herman<T>.Instance18-Mar-09 6:48 
GeneralRe: Problem with my windows service Pin
gottimukkala18-Mar-09 6:50
gottimukkala18-Mar-09 6:50 
GeneralRe: Problem with my windows service Pin
Herman<T>.Instance18-Mar-09 6:57
Herman<T>.Instance18-Mar-09 6:57 
GeneralRe: Problem with my windows service Pin
gottimukkala18-Mar-09 7:05
gottimukkala18-Mar-09 7:05 
GeneralRe: Problem with my windows service Pin
Herman<T>.Instance18-Mar-09 7:57
Herman<T>.Instance18-Mar-09 7:57 
QuestionListening for database updates in asp .net Pin
hardboy11118-Mar-09 5:00
hardboy11118-Mar-09 5:00 
AnswerRe: Listening for database updates in asp .net Pin
Abhijit Jana18-Mar-09 5:16
professionalAbhijit Jana18-Mar-09 5:16 
AnswerRe: Listening for database updates in asp .net Pin
Yusuf18-Mar-09 6:15
Yusuf18-Mar-09 6:15 
GeneralRe: Listening for database updates in asp .net Pin
hardboy11118-Mar-09 7:06
hardboy11118-Mar-09 7:06 
QuestionGeneral Webparts Related Question. Pin
mr_muskurahat18-Mar-09 4:21
mr_muskurahat18-Mar-09 4:21 
AnswerRe: General Webparts Related Question. Pin
Abhishek Sur18-Mar-09 5:20
professionalAbhishek Sur18-Mar-09 5:20 
QuestionDropdownlist problem Pin
khuzwayom18-Mar-09 4:19
khuzwayom18-Mar-09 4:19 
AnswerRe: Dropdownlist problem Pin
Abhijit Jana18-Mar-09 4:35
professionalAbhijit Jana18-Mar-09 4:35 
GeneralRe: Dropdownlist problem Pin
khuzwayom18-Mar-09 4:43
khuzwayom18-Mar-09 4:43 
GeneralRe: Dropdownlist problem Pin
Abhijit Jana18-Mar-09 5:04
professionalAbhijit Jana18-Mar-09 5:04 
GeneralRe: Dropdownlist problem Pin
khuzwayom18-Mar-09 5:09
khuzwayom18-Mar-09 5:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.