TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Goran Bibic
475
2.9k
201k
Create dinamicly button in couple columns c#
Apr 6 2018 6:48 AM
Code working fine...
Create dinamicly button in couple columns c#
If I have 22,23,24...buttons to create 5 columns with 5 buttons...and
SqlConnection con =
new
SqlConnection(
"Data Source=.\\SQLEXPRESS;Initial Catalog=bss;Integrated Security=True"
);
SqlCommand cmd =
new
SqlCommand(
"SELECT Concat(ime, cijena_sa_porezom) FROM roba_usluge"
, con);
// Getting all the data to ItemTable
var da =
new
SqlDataAdapter(cmd);
var ItemTable =
new
DataTable();
da.Fill(ItemTable);
con.Open();
Int32 count = ItemTable.Rows.Count;
con.Close();
int
top = 50;
int
left = 50;
for
(
int
i = 0; i < count; i++)
{
Button button =
new
Button();
button.Left = left;
button.Top = top;
button.Text = ItemTable.Rows[i][0].ToString();
this
.Controls.Add(button);
top += button.Height + 2;
}
Reply
Answers (
4
)
Datagrid selection changed for image?
Regular expression question