for (int i = 0; i < DT1.Rows.Count; i++)
{
PivotGridField field + i = new PivotGridField();
}
Of course, this code will not work, but how to make it work this way, as I need to create unknown number of fields.
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You cannot create fields (or, as in this case, variables) on the fly. What you can do is have an array / list / similar:
Now whenever you want “field n”, use
fields[n]