Click here to Skip to main content
15,897,226 members
Home / Discussions / C#
   

C#

 
Question.Net 2.0 operation IIS question,help me! Pin
KSCsoft13-Nov-06 23:19
KSCsoft13-Nov-06 23:19 
AnswerRe: .Net 2.0 operation IIS question,help me! Pin
Ed.Poore14-Nov-06 0:21
Ed.Poore14-Nov-06 0:21 
JokeRe: .Net 2.0 operation IIS question,help me! Pin
gus_br14-Nov-06 0:58
gus_br14-Nov-06 0:58 
GeneralRe: .Net 2.0 operation IIS question,help me! Pin
Ed.Poore14-Nov-06 1:47
Ed.Poore14-Nov-06 1:47 
JokeRe: .Net 2.0 operation IIS question,help me! Pin
gus_br14-Nov-06 2:06
gus_br14-Nov-06 2:06 
GeneralRe: .Net 2.0 operation IIS question,help me! Pin
Ed.Poore14-Nov-06 2:23
Ed.Poore14-Nov-06 2:23 
QuestionDeployment failure to PocketPC Pin
george ivanov13-Nov-06 23:05
george ivanov13-Nov-06 23:05 
QuestionProblems with counter [modified] Pin
martins8713-Nov-06 22:58
martins8713-Nov-06 22:58 
Hi! problem is - when I press the button in grid (see - private void AddButtonColumn()) for the first time, counter adds 1 to row nine, when I press it repeatedly it works only on every second click. I want it to work on every second click at all times! how can I fix that? as you can see - on a button click timer is trigered. Counters job is to count how many times timer has been started. But now - for the first time it counts when timer starts and ends, but later on it does the job right. Heres the code Im having trouble with:
...
namespace Bonuss
{
    public partial class frmList : Form
    {
        public frmList()
        {
            InitializeComponent();
            dataGridView1.CellClick += new DataGridViewCellEventHandler(dataGridView1_CellClick);
        }
        void frmList__myElapsed(object sender, long Ticks, DataGridViewRow row)
        {
            if (dataGridView1.Rows[row.Index].Tag != null)
            {
                dataGridView1[7, row.Index].Value = Ticks.ToString();
            }
        }
        private void ReloadData()
        {
            for (int i = 0; i <= dataGridView1.Rows.Count-1; i++)
            {
                if (dataGridView1.Rows[i].Tag == null)
                {
                    dataGridView1.Rows[i].Tag = new rowTag(dataGridView1.Rows[i]);
                    ((rowTag)dataGridView1.Rows[i].Tag)._myElapsed += new rowTag.myElapsed(frmList__myElapsed);
                }
                else
                {
                    int err = 0;
                }
            }
        }
        DataGridViewButtonColumn buttons;
        private void AddButtonColumn()
        {
            buttons = new DataGridViewButtonColumn();
            {
                buttons.HeaderText = "Opcijas";
                buttons.Text = "--";
                buttons.UseColumnTextForButtonValue = false;
                buttons.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
                buttons.FlatStyle = FlatStyle.Standard;
                buttons.CellTemplate.Style.BackColor = Color.Honeydew;
                buttons.DisplayIndex = 8;
                buttons.DefaultCellStyle.NullValue = "<+/->";
            }
            dataGridView1.Columns.Add(buttons);
        }
        public void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {

            if (dataGridView1.Columns[e.ColumnIndex].HeaderText=="Opcijas" )
            {
                
                try
                {
                    rowTag currentRowTag = ((rowTag)dataGridView1.Rows[e.RowIndex].Tag);
                    if (!currentRowTag.isRunning)
                    {
                        currentRowTag.Start();
                    }
                    else
                    {
                        currentRowTag.Finish();
                    }
                }
                catch (Exception)
                {
                    int a = 0;
                }
                try
                {
                    if (dataGridView1[7, e.RowIndex].Value == "X")
                    {
                        if (e.ColumnIndex == buttons.Index)
                        {
                            //MessageBox.Show("" + dataGridView1[7, e.RowIndex].Value);
                            dataGridView1[7, e.RowIndex].Value = 0;
                        }
                    }
                    else if (dataGridView1[7, e.RowIndex].Value != "X" )
                    {
                        if (e.ColumnIndex == buttons.Index)
                        {
                            dataGridView1[7, e.RowIndex].Value = "X";
                            float ft_Counter = 0;

                            try
                            {
                                ft_Counter = Convert.ToSingle(dataGridView1[9, e.RowIndex].Value);
                            }
                            catch (Exception)
                            {
                                ft_Counter = 0;
                            }

                            dataGridView1[9, e.RowIndex].Value = ft_Counter + 1;
                        }

                    }
                }
...

GeneralRe: Problems with counter Pin
Guffa13-Nov-06 23:38
Guffa13-Nov-06 23:38 
GeneralRe: Problems with counter Pin
martins8714-Nov-06 6:28
martins8714-Nov-06 6:28 
Questionhow to convert xsd schema to xml file Pin
cellardoor071613-Nov-06 22:20
cellardoor071613-Nov-06 22:20 
AnswerRe: how to convert xsd schema to xml file Pin
Christian Graus13-Nov-06 22:23
protectorChristian Graus13-Nov-06 22:23 
GeneralRe: how to convert xsd schema to xml file Pin
Eduard Keilholz14-Nov-06 4:50
Eduard Keilholz14-Nov-06 4:50 
QuestionTable or Datagrid... Pin
IamHuM13-Nov-06 22:10
IamHuM13-Nov-06 22:10 
AnswerRe: Table or Datagrid... Pin
Christian Graus13-Nov-06 22:21
protectorChristian Graus13-Nov-06 22:21 
GeneralRe: Table or Datagrid... Pin
IamHuM13-Nov-06 22:44
IamHuM13-Nov-06 22:44 
GeneralRe: Table or Datagrid... Pin
Christian Graus13-Nov-06 22:45
protectorChristian Graus13-Nov-06 22:45 
GeneralRe: Table or Datagrid... Pin
IamHuM13-Nov-06 23:00
IamHuM13-Nov-06 23:00 
QuestionNeed Source Link About RichtextBox using OpenfileDialog Pin
M Riaz Bashir13-Nov-06 21:48
M Riaz Bashir13-Nov-06 21:48 
AnswerRe: Need Source Link About RichtextBox using OpenfileDialog [modified] Pin
kkadir13-Nov-06 21:58
kkadir13-Nov-06 21:58 
GeneralRe: Need Source Link About RichtextBox using OpenfileDialog Pin
M Riaz Bashir13-Nov-06 22:32
M Riaz Bashir13-Nov-06 22:32 
AnswerRe: Need Source Link About RichtextBox using OpenfileDialog Pin
Christian Graus13-Nov-06 22:07
protectorChristian Graus13-Nov-06 22:07 
QuestionHelp needed to make a decision Pin
kkadir13-Nov-06 21:45
kkadir13-Nov-06 21:45 
AnswerRe: Help needed to make a decision Pin
Christian Graus13-Nov-06 22:08
protectorChristian Graus13-Nov-06 22:08 
AnswerRe: Help needed to make a decision Pin
Eduard Keilholz13-Nov-06 22:11
Eduard Keilholz13-Nov-06 22:11 

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.