I became religious about a year ago and my family is not. I went to Shabbat dinner with my family to a friends house and they were nice enough to buy everything kosher specifically for me. When we got there I noticed that the father was grilling chicken outside, which really took me by surprise because they know I keep Shabbat. Once I saw that, I decided not to eat anything because I figured that if I did I would transgress Shabbat because he was grilling on a fire on Shabbat. After kiddush we all sat down and everyone starting eating and I just sat there and didn’t eat. A few days later I was having dinner with my family and my father was telling me that he went back to their house for a bit and the dad told my father that he felt bad that I didn’t eat and my father told me that I kind of hurt him. Now I do feel bad that I didn’t eat because I know that if I invited someone over my house and they just say there and didn’t eat I would feel hurt as well, but at the same time I didn’t want to eat food that was cooked on Shabbat. What should I have done in this situation?
You were correct in not eating the food cooked on Shabbos. Food cooked intentionally on Shabbos is forbidden for consumption. This is known as the prohibition of Maaseh Shabbos, not to gain benefit from Shabbos violations.
In addition there is the concern of the kosher status of the grill, as they very likely cook non kosher meats there as well, which will compromise the kosher meat cooked there as well.