Questions tagged as 'c#'

2
answers

How to prevent a command

I would like to prevent my record from being saved if radiobutton were not selected. My code: private void btnSalvar_Click(object sender, EventArgs e) { if ((rdbMasculino.Checked == false) && (rdbFeminino.Checked == false...
asked by 08.10.2016 / 22:12
2
answers

Return radiobutton selection in C #

Good morning. I have a GroupBox that contains 5 RadioButton. I have a function where it gets the name of the GroupBox and it returns 1 if some RadioButton is selected and -1 if no RadioButton has been selected. But even without a RadioButton sel...
asked by 13.10.2016 / 15:17
1
answer

How to reset the DataSource property of a DataGridView and not delete the columns of the Header?

I'm filling my DataGridView with a list of objects, however, when I fill in the grid for the first time everything is fine. When I remove the DataSource property as null, the grid columns are deleted. Is it possible to reset the DataSource pr...
asked by 24.02.2017 / 15:45
1
answer

Run fast things synchronously and things delayed asynchronously?

Generally, in .NET, I run time-consuming things asynchronously so I do not catch the visual thread . In a simple example, if I have a loading in the UI, in case slow things run without awaited , they catch that loading , which was execute...
asked by 18.02.2017 / 11:41
2
answers

how to work with PartialView

I have the People Registry, and I have the Address Book, which are in two separate classes, because the goal is that the user can have 2 or more addresses, such as delivery, and billing. So I wanted to know how to use PartialView. in the case I...
asked by 17.11.2016 / 12:07
2
answers

Doing operations / handling DateTime

The idea is for the user to type in a textbox a horaEntrada and in another the horaSaida in which case these 2 variables should have the format "HH: mm" hours and minutes, only, after that by method get and set...
asked by 03.11.2016 / 22:03
1
answer

Negative return of Array.BinarySearch ()

I needed to make a comparison of the genre of methods normally created as inList or something of the sort. Searching the Microsoft documentation, I found Array.BinarySearch(T[], T) . I made this operation in my code and I was in dou...
asked by 01.02.2016 / 18:44
2
answers

How to Include an Item in an ICollection

I have a Person class that has a ICollection of Phone class. On the Person Maintenance screen I have a dataTable with the Telephones. There is a link to add a new phone, but I can not use @Html.DropDownLIstFor to request the type o...
asked by 17.02.2016 / 22:07
1
answer

Access ListListstring in a Thread

I'm using WinForms I can not access a list within a Thread . This list I already populated it through another method. If you leave the cursor on top I can see the items, but when I recover through lstPublicacoes[0].ToString();...
asked by 05.02.2016 / 23:54
1
answer

Show Calculator on Stack

I have a problem here and I need some help, I have to do a job for college, and a calculator, so far so good I've already done the calculator, but the problem and the next, I need to demonstrate the numbers in stack, someone knows how to do this...
asked by 19.10.2017 / 13:37